/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
* {
  box-sizing: border-box;
}

:root {
  --rp-bg: #070b14;
  --rp-bg-soft: #0c1224;
  --rp-surface: #0c1224;
  --rp-surface-2: #070b14;
  --rp-border: #1e293b;
  --rp-border-strong: #334155;
  --rp-text: #f8fafc;
  --rp-text-soft: #cbd5e1;
  --rp-text-muted: #64748b;
  --rp-navy-1: #070b14;
  --rp-navy-2: #0c1224;
  --rp-navy-3: #1e293b;
  --rp-gold: #fbbf24; /* Amber 400 */
  --rp-gold-strong: #f59e0b; /* Amber 500 */
  --rp-success: #34d399;
  --rp-success-bg: rgba(52, 211, 153, 0.1);
  --rp-warning: #fbbf24;
  --rp-warning-bg: rgba(251, 191, 36, 0.1);
  --rp-danger: #f87171;
  --rp-danger-bg: rgba(248, 113, 113, 0.1);
  --rp-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  --rp-shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.3);
  --rp-radius-xl: 24px;
  --rp-radius-lg: 18px;
  --rp-radius-md: 14px;
  --rp-radius-sm: 10px;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--rp-bg);
  color: var(--rp-text);
  font-family: 'Inter', 'Tajawal', Tahoma, Arial, sans-serif;
  direction: rtl;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

textarea {
  resize: vertical;
}

::placeholder {
  color: #4b5563;
}

.loading-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 22%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%);
}

.loading-card {
  min-width: 280px;
  max-width: 520px;
  padding: 24px;
  border-radius: 22px;
  background: #0c1224;
  border: 1px solid rgba(245, 158, 11, 0.2);
  box-shadow: var(--rp-shadow);
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  color: var(--rp-text);
}

.erp-auth-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 22%),
    radial-gradient(circle at bottom left, rgba(16, 58, 122, 0.10), transparent 24%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%);
}

.erp-auth-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(0,0,0,0.4), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(245, 158, 11, 0.14), transparent 18%);
}

.erp-auth-card {
  position: relative;
  z-index: 1;
  width: min(100%, 580px);
  padding: 28px 26px;
  border-radius: 30px;
  background: rgba(12, 18, 36, 0.95);
  border: 1px solid rgba(245, 158, 11, 0.2);
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255,255,255,0.05);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}

.erp-auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.erp-auth-brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(16, 58, 122, 0.12));
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--rp-gold);
  font-size: 26px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.erp-auth-brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
  color: var(--rp-text);
}

.erp-auth-brand p {
  margin: 5px 0 0;
  color: var(--rp-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.erp-auth-head {
  text-align: right;
  margin-bottom: 22px;
}

.erp-auth-head h2 {
  margin: 0 0 10px;
  font-size: 40px;
  line-height: 1.15;
  font-weight: 900;
  color: #fff;
}

.erp-auth-head p {
  margin: 0;
  color: var(--rp-text-soft);
  line-height: 1.9;
  font-size: 16px;
}

.erp-auth-form {
  display: grid;
  grid-gap: 16px;
  gap: 16px;
}

.erp-auth-submit {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #070b14;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.15);
  transition: 0.2s ease;
}

.erp-auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(245, 158, 11, 0.25);
}

.erp-auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.erp-auth-error {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  line-height: 1.8;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
}

.erp-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  direction: rtl;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%);
}

.erp-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100vh;
  padding: 28px;
}

.erp-sidebar {
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 22%),
    linear-gradient(180deg, #0c1224 0%, #070b14 100%);
  color: #fff;
  padding: 24px 18px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  align-self: flex-start;
  border-left: 1px solid rgba(245, 158, 11, 0.1);
  overflow-y: auto;
}

.erp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.erp-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.34);
  color: var(--rp-gold);
  font-size: 24px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.erp-brand-text h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
  color: #fff;
}

.erp-brand-text p {
  margin: 5px 0 0;
  font-size: 11px;
  color: rgba(255,255,255,0.72);
}

.erp-sidebar-current {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.erp-sidebar-current-label {
  font-size: 11px;
  color: rgba(255,255,255,0.62);
  margin-bottom: 6px;
  font-weight: 700;
}

.erp-sidebar-current-value {
  font-size: 15px;
  font-weight: 900;
  color: var(--rp-gold);
}

.erp-sidebar-profile {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  display: grid;
  grid-gap: 12px;
  gap: 12px;
}

.erp-sidebar-profile-item {
  display: grid;
  grid-gap: 4px;
  gap: 4px;
}

.erp-sidebar-profile-key {
  color: rgba(255,255,255,0.64);
  font-size: 11px;
}

.erp-sidebar-section-title {
  margin: 0 0 10px;
  color: rgba(255,255,255,0.58);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

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

.erp-nav-group {
  display: grid;
  grid-gap: 4px;
  gap: 4px;
}

.erp-nav-group-children {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
}

.erp-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  color: rgba(255,255,255,0.92);
  border: 1px solid transparent;
  transition: 0.22s ease;
  font-weight: 700;
  font-size: 15px;
}

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

.erp-nav-item.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(245, 158, 11, 0.05));
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.erp-nav-group-header {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.erp-nav-child {
  background: rgba(255,255,255,0.03);
}

.erp-chevron {
  font-weight: 900;
  font-size: 16px;
  opacity: 0.9;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

.erp-chevron.open {
  transform: rotate(90deg);
}

.erp-nav-item-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.erp-nav-item-label {
  font-size: 15px;
  font-weight: 800;
}

.erp-nav-item-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.58);
  font-weight: 600;
}

.erp-sidebar-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.erp-logout-btn {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.1);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.erp-logout-btn:hover {
  background: rgba(245, 158, 11, 0.18);
}

.erp-mobile-menu-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1400;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #070b14;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.2);
  cursor: pointer;
}

.erp-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.50);
  z-index: 1498;
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
}

.erp-mobile-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 88vw;
  max-width: 360px;
  height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 22%),
    linear-gradient(180deg, #0c1224 0%, #070b14 100%);
  color: #fff;
  padding: 22px 16px 18px;
  box-sizing: border-box;
  overflow-y: auto;
  z-index: 1499;
  box-shadow: -14px 0 36px rgba(0, 0, 0, 0.5);
}

.erp-mobile-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.erp-mobile-sidebar-title {
  font-size: 18px;
  font-weight: 900;
}

.erp-mobile-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.erp-workspace-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin: 0 0 22px;
  padding: 20px 22px;
  border: 1px solid var(--rp-border);
  background: #0c1224;
  border-radius: 24px;
  box-shadow: var(--rp-shadow-soft);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}

.erp-workspace-title-wrap {
  text-align: right;
}

.erp-page-eyebrow {
  color: var(--rp-gold);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}

.erp-page-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 900;
  color: #fff;
}

.erp-page-subtitle {
  margin: 10px 0 0;
  color: var(--rp-text-soft);
  line-height: 1.9;
  max-width: 860px;
}

.erp-topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.erp-topbar-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  color: var(--rp-text-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.erp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  grid-gap: 18px;
  gap: 18px;
  padding: 24px;
  background: linear-gradient(135deg, #0c1224 0%, #070b14 100%);
  border: 1px solid var(--rp-border);
  border-radius: 28px;
  box-shadow: var(--rp-shadow-soft);
  margin-bottom: 22px;
}

.erp-hero h2 {
  margin: 8px 0 10px;
  font-size: 30px;
  line-height: 1.25;
}

.erp-hero p {
  margin: 0;
  color: var(--rp-text-soft);
  line-height: 1.9;
}

.erp-hero-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: var(--rp-gold);
  border: 1px solid rgba(245, 158, 11, 0.22);
  font-size: 12px;
  font-weight: 900;
}

.erp-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.erp-stat-panel {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
}

.erp-stat-box {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #0c1224 0%, #070b14 100%);
  border: 1px solid rgba(245, 158, 11, 0.15);
  color: #fff;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
}

.erp-stat-box-label {
  font-size: 12px;
  opacity: 0.78;
  font-weight: 700;
}

.erp-stat-box-value {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 900;
}

.erp-quick-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-gap: 16px;
  gap: 16px;
  margin: 0 0 22px 0;
}

.erp-metric-tile {
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-radius: 22px;
  box-shadow: var(--rp-shadow-soft);
  padding: 18px;
  display: grid;
  grid-gap: 14px;
  gap: 14px;
}

.erp-metric-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.erp-metric-label {
  color: var(--rp-text-muted);
  font-size: 13px;
  font-weight: 800;
}

.erp-metric-value {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 900;
  color: var(--rp-text);
}

.erp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-gap: 16px;
  gap: 16px;
  margin-bottom: 22px;
}

.erp-card {
  min-height: 148px;
  padding: 20px;
  border-radius: 22px;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  box-shadow: var(--rp-shadow-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.erp-card-title {
  color: var(--rp-text-muted);
  font-size: 13px;
  font-weight: 800;
}

.erp-card-value {
  font-size: 30px;
  font-weight: 900;
  color: var(--rp-gold);
}

.erp-card-note {
  color: var(--rp-text-soft);
  font-size: 12px;
  line-height: 1.7;
}

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

.erp-section-card {
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-radius: 22px;
  box-shadow: var(--rp-shadow-soft);
  padding: 18px;
}

.erp-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.erp-section-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.erp-section-head p {
  margin: 6px 0 0;
  color: var(--rp-text-muted);
  font-size: 13px;
  line-height: 1.8;
}

.erp-mini-note {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  color: var(--rp-text-soft);
  font-size: 12px;
  font-weight: 800;
}

.erp-table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--rp-border);
  border-radius: 18px;
}

.erp-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.erp-table th,
.erp-table td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid var(--rp-border);
  font-size: 13px;
  vertical-align: middle;
}

.erp-table th {
  background: var(--rp-surface-2);
  color: var(--rp-text-soft);
  font-weight: 900;
}

.erp-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.erp-form-shell {
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-radius: 22px;
  box-shadow: var(--rp-shadow-soft);
  padding: 18px;
  margin-bottom: 18px;
}

.erp-form-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 900;
  text-align: right;
}

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

.erp-form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.erp-form-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.erp-label {
  display: block;
  margin-bottom: 8px;
  color: var(--rp-text-soft);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.erp-input,
.erp-search {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--rp-border);
  background: #070b14;
  color: var(--rp-text);
  padding: 10px 14px;
  outline: none;
  transition: 0.2s ease;
}

.erp-input:focus,
.erp-search:focus {
  border-color: rgba(245, 158, 11, 0.42);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08);
}

.erp-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.erp-btn-primary,
.erp-btn-secondary,
.erp-btn-danger {
  min-height: 42px;
  border-radius: 14px;
  padding: 0 16px;
  border: none;
  cursor: pointer;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.erp-btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #070b14 !important;
}

.erp-btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-0.5px);
}

.erp-btn-secondary {
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--rp-border);
}

.erp-btn-secondary:hover {
  background: #334155;
}

.erp-btn-danger {
  background: #b91c1c;
  color: #fff;
}

.erp-btn-primary:disabled,
.erp-btn-secondary:disabled,
.erp-btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.erp-form-message {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.08);
  color: var(--rp-gold);
  line-height: 1.8;
  text-align: right;
}

.erp-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.erp-badge.success {
  background: var(--rp-success-bg);
  color: var(--rp-success);
}

.erp-badge.warning {
  background: var(--rp-warning-bg);
  color: var(--rp-warning);
}

.erp-chart-list {
  display: grid;
  grid-gap: 14px;
  gap: 14px;
}

.erp-chart-row {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
}

.erp-chart-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--rp-text-soft);
  font-size: 13px;
  font-weight: 800;
}

.erp-chart-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #1e293b;
  overflow: hidden;
}

.erp-chart-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d97706 0%, #fbbf24 100%);
}

.erp-alert-list {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
}

.erp-alert-item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.15);
  background: var(--rp-surface-2);
}

.erp-alert-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.erp-alert-item p {
  margin: 0;
  color: var(--rp-text-soft);
  line-height: 1.8;
  font-size: 13px;
}

.erp-dual-bar-metric {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
}

.erp-dual-bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--rp-text-soft);
  font-size: 13px;
  font-weight: 800;
}

.erp-factory-card {
  background: linear-gradient(180deg, #0c1224 0%, #070b14 100%);
  border: 1px solid var(--rp-border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--rp-shadow-soft);
  display: grid;
  grid-gap: 14px;
  gap: 14px;
}

.erp-factory-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.erp-factory-name {
  font-size: 22px;
  font-weight: 900;
  color: var(--rp-text);
}

.erp-factory-id {
  margin-top: 6px;
  color: var(--rp-text-muted);
  font-size: 13px;
  font-weight: 700;
}

.erp-factory-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 12px;
  gap: 12px;
}

.erp-factory-stat-box {
  padding: 14px;
  border-radius: 16px;
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  text-align: right;
}

.erp-factory-stat-label {
  color: var(--rp-text-muted);
  font-size: 12px;
  font-weight: 800;
}

.erp-factory-stat-value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 900;
}

@media (max-width: 1200px) {
  .erp-hero,
  .erp-workspace-topbar {
    grid-template-columns: 1fr;
  }

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

  .erp-workspace-topbar {
    display: grid;
  }
}

@media (max-width: 991px) {
  .erp-shell {
    display: block;
  }

  .erp-sidebar {
    display: none;
  }

  .erp-main {
    padding: 80px 16px 20px;
  }

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

  .erp-auth-card {
    padding: 24px 18px;
  }

  .erp-auth-head h2 {
    font-size: 32px;
  }

  .erp-topbar-actions {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .erp-main {
    padding: 78px 12px 18px;
  }

  .erp-kpi-grid,
  .erp-quick-strip,
  .erp-factory-stats {
    grid-template-columns: 1fr;
  }

  .erp-card-value,
  .erp-metric-value {
    font-size: 24px;
  }

  .erp-hero h2,
  .erp-page-title {
    font-size: 24px;
  }

  .erp-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .erp-auth-card {
    width: 100%;
    padding: 22px 14px;
    border-radius: 24px;
  }

  .erp-auth-head h2 {
    font-size: 28px;
  }

  .erp-auth-head p {
    font-size: 14px;
  }
}

.rp-loading-wrap {
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 78% 18%, rgba(245, 158, 11, 0.16), transparent 24%),
    radial-gradient(circle at 18% 82%, rgba(59, 130, 246, 0.10), transparent 26%),
    linear-gradient(135deg, #070b14 0%, #0c1224 52%, #070b14 100%);
}

.rp-loading-card {
  width: min(92vw, 420px);
  padding: 34px 30px;
  border-radius: 28px;
  background: rgba(12, 18, 36, 0.94);
  border: 1px solid rgba(245, 158, 11, 0.22);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
}

.rp-loading-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #070b14;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  box-shadow: 0 16px 32px rgba(245, 158, 11, 0.20);
}

.rp-loading-eyebrow {
  margin-bottom: 8px;
  color: #fbbf24;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-loading-title {
  color: #f8fafc;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.5;
}

.rp-loading-subtitle {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.8;
}

.rp-loading-spinner {
  width: 42px;
  height: 42px;
  margin: 22px auto 0;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.18);
  border-top-color: #f59e0b;
  border-left-color: rgba(245, 158, 11, 0.45);
  animation: rpSpin 0.8s linear infinite;
}

@keyframes rpSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== Royal Palace Dashboard Pro - Font Fix ========== */
body, html, input, button, select, textarea, .erp-nav-item-label, .erp-brand-text h2 {
  font-family: "Inter", "Tajawal", sans-serif !important;
}

/* ========== Royal Palace Dashboard Pro - Premium Styles ========== */
.rp-dash-shell {
  min-height: 100vh;
  display: flex;
  direction: rtl;
  background:
    radial-gradient(circle at 78% 18%, rgba(245, 158, 11, 0.08), transparent 28%),
    radial-gradient(circle at 18% 82%, rgba(59, 130, 246, 0.06), transparent 30%),
    linear-gradient(135deg, #050810 0%, #0a0f1f 52%, #050810 100%);
}

.rp-dash-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100vh;
  padding: 24px 28px 40px;
}

.rp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(12, 18, 36, 0.92) 0%, rgba(10, 15, 31, 0.92) 100%);
  border: 1px solid rgba(245, 158, 11, 0.18);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  margin-bottom: 22px;
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  flex-wrap: wrap;
}

.rp-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rp-topbar-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  font-weight: 900;
  font-size: 16px;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.28);
}

.rp-topbar-title {
  color: #f8fafc;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.2px;
  margin: 0;
}

.rp-topbar-sub {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

.rp-topbar-center {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-period-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-weight: 800;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rp-period-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.04);
}

.rp-period-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.28);
}

.rp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rp-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rp-icon-btn:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.32);
  transform: translateY(-1px);
}

.rp-icon-btn.spinning {
  animation: rpSpin 0.8s linear infinite;
}

.rp-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.rp-clock-time {
  color: #fbbf24;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.rp-clock-date {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  margin-top: 2px;
}

.rp-hero {
  position: relative;
  padding: 22px 26px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.10) 0%, rgba(59, 130, 246, 0.08) 100%),
    linear-gradient(135deg, #0c1224 0%, #070b14 100%);
  border: 1px solid rgba(245, 158, 11, 0.16);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
  margin-bottom: 22px;
  overflow: hidden;
}

.rp-hero::before {
  content: "";
  position: absolute;
  top: -80px;
  left: -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.16), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.rp-hero::after {
  content: "";
  position: absolute;
  bottom: -100px;
  right: -50px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.10), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.rp-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.rp-hero-eyebrow {
  color: #fbbf24;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.rp-hero-title {
  margin: 0;
  color: #f8fafc;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.4px;
  line-height: 1.25;
}

.rp-hero-subtitle {
  margin: 8px 0 0;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
}

.rp-hero-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.rp-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
}

.rp-hero-pill.success {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.32);
  color: #4ade80;
}

.rp-hero-pill.warning {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
}

.rp-hero-pill.danger {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.32);
  color: #f87171;
}

.rp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 14px;
  gap: 14px;
  margin-bottom: 22px;
}

.rp-kpi-card {
  position: relative;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(12, 18, 36, 0.90) 0%, rgba(10, 15, 31, 0.90) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  overflow: hidden;
  text-decoration: none;
  display: block;
}

.rp-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--rp-kpi-color, #f59e0b);
  opacity: 0.85;
}

.rp-kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.32);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.50);
}

.rp-kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.rp-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--rp-kpi-bg, rgba(245, 158, 11, 0.12));
  color: var(--rp-kpi-color, #f59e0b);
  font-size: 18px;
}

.rp-kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.rp-kpi-trend.up {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

.rp-kpi-trend.down {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.rp-kpi-trend.flat {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}

.rp-kpi-label {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.rp-kpi-value {
  margin-top: 6px;
  color: #f8fafc;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.4px;
  line-height: 1.15;
}

.rp-kpi-note {
  margin-top: 4px;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
}

.rp-kpi-spark {
  margin-top: 12px;
  height: 38px;
  width: 100%;
}

.rp-tabs {
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}

.rp-tabs::-webkit-scrollbar { display: none; }

.rp-tab {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rp-tab:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.04);
}

.rp-tab.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.32);
}

.rp-tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  font-size: 10px;
  font-weight: 900;
}

.rp-tab.active .rp-tab-badge {
  background: rgba(5, 8, 16, 0.20);
  color: #050810;
}

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

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

.rp-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 14px;
  gap: 14px;
  margin-bottom: 22px;
}

.rp-panel {
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(12, 18, 36, 0.92) 0%, rgba(10, 15, 31, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

.rp-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.rp-panel-title {
  margin: 0;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.2px;
}

.rp-panel-sub {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

.rp-panel-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.24);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.rp-empty {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.rp-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.rp-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.rp-product-row:hover {
  background: rgba(245, 158, 11, 0.04);
  border-color: rgba(245, 158, 11, 0.18);
}

.rp-product-rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  font-weight: 900;
  font-size: 12px;
  flex-shrink: 0;
}

.rp-product-name {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  flex: 1 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-product-meta {
  text-align: left;
  flex-shrink: 0;
}

.rp-product-revenue {
  color: #4ade80;
  font-weight: 900;
  font-size: 13px;
}

.rp-product-qty {
  color: #94a3b8;
  font-size: 10px;
  margin-top: 2px;
}

.rp-insight {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  margin-bottom: 10px;
}

.rp-insight.success { border-right: 3px solid #22c55e; }
.rp-insight.warning { border-right: 3px solid #f59e0b; }
.rp-insight.danger  { border-right: 3px solid #ef4444; }
.rp-insight.info    { border-right: 3px solid #3b82f6; }

.rp-insight-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 16px;
}

.rp-insight.success .rp-insight-icon { background: rgba(34, 197, 94, 0.12); color: #4ade80; }
.rp-insight.warning .rp-insight-icon { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.rp-insight.danger  .rp-insight-icon { background: rgba(239, 68, 68, 0.12); color: #f87171; }
.rp-insight.info    .rp-insight-icon { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }

.rp-insight-body { flex: 1 1; min-width: 0; }

.rp-insight-title {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 4px;
}

.rp-insight-desc {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  margin: 0;
}

.rp-feed-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 6px;
}

.rp-feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  margin-top: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

.rp-feed-body { flex: 1 1; min-width: 0; }

.rp-feed-title {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 2px;
}

.rp-feed-meta {
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
}

.rp-factory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-gap: 14px;
  gap: 14px;
}

.rp-factory-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(12, 18, 36, 0.94) 0%, rgba(10, 15, 31, 0.94) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
  cursor: pointer;
}

.rp-factory-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.32);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
}

.rp-factory-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.rp-factory-icon {
  font-size: 22px;
}

.rp-factory-status {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.rp-factory-status.active {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.32);
}

.rp-factory-status.inactive {
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.32);
}

.rp-factory-name {
  color: #f8fafc;
  font-size: 15px;
  font-weight: 900;
  margin: 0 0 12px;
}

.rp-factory-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 10px;
  gap: 10px;
}

.rp-factory-stat {
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.rp-factory-stat-label {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
}

.rp-factory-stat-value {
  margin-top: 4px;
  color: #f8fafc;
  font-size: 18px;
  font-weight: 900;
}

.rp-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.rp-quick-link {
  padding: 14px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  display: block;
}

.rp-quick-link:hover {
  transform: translateY(-2px);
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
}

.rp-quick-icon {
  display: block;
  font-size: 22px;
  margin-bottom: 6px;
}

.rp-skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: rpShimmer 1.4s ease-in-out infinite;
  border-radius: 12px;
}

@keyframes rpShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.rp-fade-in {
  animation: rpFadeIn 0.5s ease-out forwards;
  opacity: 0;
}

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

.rp-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.rp-status-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.rp-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.rp-status-dot.warning { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }
.rp-status-dot.danger  { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }

@media (max-width: 1280px) {
  .rp-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .rp-grid-2 { grid-template-columns: 1fr; }
  .rp-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .rp-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 991px) {
  .rp-dash-shell { display: block; }
  .rp-dash-main { padding: 80px 14px 24px; }
  .rp-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .rp-grid-3 { grid-template-columns: 1fr; }
  .rp-topbar { padding: 12px; }
  .rp-topbar-center { display: none; }
  .rp-hero-title { font-size: 20px; }
}

@media (max-width: 640px) {
  .rp-kpi-grid { grid-template-columns: 1fr; }
  .rp-grid-4 { grid-template-columns: 1fr; }
  .rp-kpi-value { font-size: 20px; }
  .rp-clock { display: none; }
}

/* ========== Royal Palace Sidebar Pro v2 ========== */
.rp-sidebar {
  width: 290px;
  min-width: 290px;
  max-width: 290px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0a1024 0%, #060916 100%);
  color: #f1f5f9;
  padding: 18px 14px;
  flex-shrink: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  align-self: flex-start;
  border-left: 1px solid rgba(245, 158, 11, 0.10);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.3) transparent;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-sidebar::-webkit-scrollbar { width: 6px; }
.rp-sidebar::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 999px;
}
.rp-sidebar::-webkit-scrollbar-track { background: transparent; }

.rp-sidebar-collapsed {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  padding: 18px 8px;
}

.rp-sidebar-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-sidebar-brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.32),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.rp-brand-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  border: 2px solid rgba(245, 158, 11, 0.5);
  opacity: 0;
  animation: rpBrandPulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes rpBrandPulse {
  0% { opacity: 0.7; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.18); }
}

.rp-sidebar-brand-text {
  flex: 1 1;
  min-width: 0;
}

.rp-sidebar-brand-text h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.rp-sidebar-brand-text p {
  margin: 3px 0 0;
  font-size: 10px;
  color: rgba(245, 158, 11, 0.85);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-collapse-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  transform: translateX(-2px);
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.rp-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.rp-search-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  pointer-events: none;
}

.rp-search-input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  padding: 0 30px 0 30px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.rp-search-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.rp-search-wrap.focused .rp-search-input {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.06);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.rp-search-clear {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.rp-search-clear:hover { background: rgba(239, 68, 68, 0.3); }

.rp-sidebar-current {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.rp-sidebar-current-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.rp-sidebar-current-value {
  font-size: 13px;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: -0.2px;
}

.rp-sidebar-profile {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-profile-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.32);
}

.rp-profile-status {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0a1024;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.rp-profile-info {
  flex: 1 1;
  min-width: 0;
}

.rp-profile-name {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-profile-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  margin-top: 2px;
}

.rp-profile-key { color: rgba(255, 255, 255, 0.55); font-weight: 700; }
.rp-profile-row strong { color: #fbbf24; font-weight: 800; font-size: 10px; }

.rp-theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  margin-bottom: 12px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  justify-content: center;
}

.rp-theme-toggle:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
  transform: translateY(-1px);
}

.rp-theme-icon {
  font-size: 16px;
  line-height: 1;
}

.rp-sidebar-collapsed .rp-theme-toggle {
  padding: 0;
  height: 42px;
}

.rp-sidebar-section-title {
  margin: 14px 0 8px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rp-nav {
  display: grid;
  grid-gap: 3px;
  gap: 3px;
}

.rp-nav-group {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  margin-bottom: 4px;
}

.rp-nav-group-body {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  padding: 4px 0 6px 0;
  margin-right: 4px;
  border-right: 2px solid rgba(245, 158, 11, 0.14);
  animation: rpFadeSlide 0.22s ease-out;
}

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

.rp-nav-item,
.rp-nav-group-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-nav-item:hover,
.rp-nav-group-head:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  transform: translateX(-2px);
}

.rp-nav-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(245, 158, 11, 0.06));
  border-color: rgba(245, 158, 11, 0.34);
  color: #fbbf24 !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rp-nav-active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: -14px;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.rp-sidebar-collapsed .rp-nav-active::before {
  right: -8px;
}

.rp-nav-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-item:hover .rp-nav-bullet { background: rgba(245, 158, 11, 0.6); }
.rp-nav-active .rp-nav-bullet {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.rp-nav-child .rp-nav-bullet { width: 4px; height: 4px; }

.rp-group-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-group-head:hover .rp-group-icon {
  background: rgba(245, 158, 11, 0.16);
  transform: scale(1.05);
}

.rp-group-open .rp-group-icon {
  background: rgba(245, 158, 11, 0.14);
}

.rp-nav-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1;
  min-width: 0;
}

.rp-nav-label {
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-active .rp-nav-hint { color: rgba(251, 191, 36, 0.7); }

.rp-nav-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
  flex-shrink: 0;
  animation: rpDotPulse 1.6s ease-in-out infinite;
}

@keyframes rpDotPulse {
  50% { opacity: 0.5; transform: scale(0.85); }
}

.rp-chevron {
  font-weight: 900;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.rp-chevron.open { transform: rotate(90deg); color: #fbbf24; }

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  padding: 10px;
  justify-content: center;
}

.rp-sidebar-collapsed .rp-nav-bullet { display: none; }
.rp-sidebar-collapsed .rp-group-icon {
  width: 32px; height: 32px; font-size: 16px;
}

.rp-nav-empty {
  text-align: center;
  padding: 30px 14px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 700;
}

.rp-sidebar-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-logout-btn {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.rp-logout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.42);
  transform: translateY(-1px);
}

.rp-logout-icon { font-size: 16px; }

.rp-sidebar-version {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
}

.rp-status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: rpDotPulse 2s ease-in-out infinite;
}

.rp-mobile-menu-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1400;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.32);
}

.rp-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 1498;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: rpFadeIn 0.22s ease-out;
}

.rp-sidebar-mobile {
  position: fixed;
  top: 0;
  right: 0;
  width: 88vw;
  max-width: 340px;
  height: 100vh;
  z-index: 1499;
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.55);
  animation: rpSlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rpSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.rp-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rp-mobile-title {
  font-size: 16px;
  font-weight: 900;
  color: #fbbf24;
}

.rp-mobile-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 991px) {
  .rp-sidebar { display: none; }
  .erp-shell { display: block; }
  .erp-main, .rp-dash-main { padding-top: 80px; }
}

[data-theme="dark"] {
  --rp-bg: #0a1024;
  --rp-surface: #0c1224;
  --rp-text: #f8fafc;
  --rp-border: rgba(245, 158, 11, 0.12);
}

[data-theme="light"] {
  --rp-bg: #f3f5f9;
  --rp-bg-soft: #eef2f7;
  --rp-surface: #ffffff;
  --rp-surface-2: #f8fafc;
  --rp-border: #dde5ef;
  --rp-border-strong: #cfd9e6;
  --rp-text: #0f172a;
  --rp-text-soft: #475569;
  --rp-text-muted: #64748b;
  --rp-navy-1: #08172f;
  --rp-navy-2: #0b1f4d;
  --rp-navy-3: #103a7a;
  --rp-gold: #c9a66b;
  --rp-gold-strong: #d6b47a;
  --rp-success: #15803d;
  --rp-success-bg: #e8f7ee;
  --rp-warning: #b45309;
  --rp-warning-bg: #fff4df;
  --rp-danger: #b91c1c;
  --rp-danger-bg: #fee2e2;
  --rp-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --rp-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] body,
[data-theme="light"] .erp-shell {
  background:
    radial-gradient(circle at top right, rgba(201, 166, 107, 0.08), transparent 20%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: var(--rp-text);
}

[data-theme="light"] .erp-main {
  color: var(--rp-text);
}

[data-theme="light"] .erp-section-card,
[data-theme="light"] .erp-card,
[data-theme="light"] .erp-form-shell,
[data-theme="light"] .erp-metric-tile,
[data-theme="light"] .erp-workspace-topbar {
  background: var(--rp-surface);
  border-color: var(--rp-border);
  color: var(--rp-text);
}

[data-theme="light"] .erp-table th {
  background: var(--rp-surface-2);
  color: var(--rp-text-soft);
}

[data-theme="light"] .erp-table td {
  color: var(--rp-text);
}

[data-theme="light"] .erp-input,
[data-theme="light"] .erp-search {
  background: #ffffff;
  color: var(--rp-text);
  border-color: var(--rp-border);
}

[data-theme="dark"] {
  --rp-bg: #070b14;
  --rp-bg-soft: #0c1224;
  --rp-surface: #0c1224;
  --rp-surface-2: #070b14;
  --rp-border: #1e293b;
  --rp-border-strong: #334155;
  --rp-text: #f8fafc;
  --rp-text-soft: #cbd5e1;
  --rp-text-muted: #64748b;
  --rp-navy-1: #070b14;
  --rp-navy-2: #0c1224;
  --rp-navy-3: #1e293b;
  --rp-gold: #fbbf24;
  --rp-gold-strong: #f59e0b;
  --rp-success: #34d399;
  --rp-success-bg: rgba(52, 211, 153, 0.1);
  --rp-warning: #fbbf24;
  --rp-warning-bg: rgba(251, 191, 36, 0.1);
  --rp-danger: #f87171;
  --rp-danger-bg: rgba(248, 113, 113, 0.1);
  --rp-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  --rp-shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body,
[data-theme="dark"] .erp-shell {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%);
  color: var(--rp-text);
}

[data-theme="dark"] .erp-main {
  color: var(--rp-text);
}

[data-theme="dark"] .erp-section-card,
[data-theme="dark"] .erp-card,
[data-theme="dark"] .erp-form-shell,
[data-theme="dark"] .erp-metric-tile,
[data-theme="dark"] .erp-workspace-topbar {
  background: var(--rp-surface);
  border-color: var(--rp-border);
  color: var(--rp-text);
}

[data-theme="dark"] .erp-input,
[data-theme="dark"] .erp-search {
  background: #070b14;
  color: var(--rp-text);
  border-color: var(--rp-border);
}

[data-theme="light"] {
  --rp-bg: #f3f5f9;
  --rp-bg-soft: #eef2f7;
  --rp-surface: #ffffff;
  --rp-surface-2: #f8fafc;
  --rp-border: #dde5ef;
  --rp-border-strong: #cfd9e6;
  --rp-text: #0f172a;
  --rp-text-soft: #475569;
  --rp-text-muted: #64748b;
  --rp-gold: #c9a66b;
  --rp-gold-strong: #d6b47a;
  --rp-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --rp-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] {
  --rp-bg: #070b14;
  --rp-bg-soft: #0c1224;
  --rp-surface: #0c1224;
  --rp-surface-2: #070b14;
  --rp-border: #1e293b;
  --rp-border-strong: #334155;
  --rp-text: #f8fafc;
  --rp-text-soft: #cbd5e1;
  --rp-text-muted: #64748b;
  --rp-gold: #fbbf24;
  --rp-gold-strong: #f59e0b;
  --rp-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  --rp-shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] body,
[data-theme="light"] .erp-shell {
  background:
    radial-gradient(circle at top right, rgba(201, 166, 107, 0.08), transparent 20%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: var(--rp-text);
}

[data-theme="dark"] body,
[data-theme="dark"] .erp-shell {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%);
  color: var(--rp-text);
}

[data-theme="light"] .erp-main {
  color: var(--rp-text);
}

[data-theme="dark"] .erp-main {
  color: var(--rp-text);
}

[data-theme="light"] .erp-section-card,
[data-theme="light"] .erp-card,
[data-theme="light"] .erp-form-shell,
[data-theme="light"] .erp-metric-tile,
[data-theme="light"] .erp-workspace-topbar,
[data-theme="light"] .erp-table-shell {
  background: var(--rp-surface);
  border-color: var(--rp-border);
  color: var(--rp-text);
}

[data-theme="dark"] .erp-section-card,
[data-theme="dark"] .erp-card,
[data-theme="dark"] .erp-form-shell,
[data-theme="dark"] .erp-metric-tile,
[data-theme="dark"] .erp-workspace-topbar,
[data-theme="dark"] .erp-table-shell {
  background: var(--rp-surface);
  border-color: var(--rp-border);
  color: var(--rp-text);
}

[data-theme="light"] .erp-input,
[data-theme="light"] .erp-search,
[data-theme="light"] .erp-sidebar-search {
  background: #ffffff;
  color: var(--rp-text);
  border-color: var(--rp-border);
}

[data-theme="dark"] .erp-input,
[data-theme="dark"] .erp-search,
[data-theme="dark"] .erp-sidebar-search {
  background: #070b14;
  color: var(--rp-text);
  border-color: var(--rp-border);
}

.erp-sidebar {
  transition: width 0.22s ease, min-width 0.22s ease, max-width 0.22s ease, padding 0.22s ease;
}

.erp-sidebar.is-collapsed {
  width: 70px;
  min-width: 70px;
  max-width: 70px;
  padding: 18px 10px;
}

.erp-sidebar-top-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.erp-sidebar.is-collapsed .erp-sidebar-top-actions {
  justify-content: center;
}

.erp-sidebar-icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.10);
  color: var(--rp-gold);
  cursor: pointer;
  font-weight: 900;
  transition: 0.2s ease;
}

.erp-sidebar-icon-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  transform: translateY(-1px);
}

.erp-sidebar.is-collapsed .erp-brand {
  justify-content: center;
}

.erp-sidebar.is-collapsed .erp-brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
}

.erp-theme-toggle {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.20);
  background: rgba(245, 158, 11, 0.08);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  transition: 0.2s ease;
}

.erp-theme-toggle:hover {
  background: rgba(245, 158, 11, 0.15);
}

.erp-theme-toggle span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #070b14;
  font-weight: 900;
}

.erp-theme-toggle strong {
  font-size: 13px;
  color: #fff;
}

.erp-sidebar.is-collapsed .erp-theme-toggle {
  padding: 0;
}

.erp-sidebar-search-wrap {
  position: relative;
  margin-bottom: 14px;
}

.erp-sidebar-search {
  width: 100%;
  min-height: 42px;
  padding: 0 14px 0 38px;
  border-radius: 15px;
  outline: none;
  font-size: 13px;
  font-weight: 700;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.erp-sidebar-search:focus {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08);
}

.erp-sidebar-search-wrap button {
  position: absolute;
  left: 8px;
  top: 7px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--rp-text-soft);
  cursor: pointer;
  font-weight: 900;
}

.erp-sidebar-empty {
  padding: 14px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px dashed rgba(148, 163, 184, 0.16);
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.erp-nav-item {
  position: relative;
}

.erp-nav-group-header {
  width: 100%;
  text-align: right;
  cursor: pointer;
}

.erp-nav-icon {
  width: 28px;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(245, 158, 11, 0.10);
  color: var(--rp-gold);
  font-size: 14px;
  line-height: 1;
}

.erp-sidebar.is-collapsed .erp-nav {
  gap: 10px;
}

.erp-sidebar.is-collapsed .erp-nav-item {
  justify-content: center;
  padding: 10px;
  min-height: 48px;
}

.erp-sidebar.is-collapsed .erp-nav-icon {
  width: 34px;
  min-width: 34px;
  height: 34px;
}

.erp-sidebar.is-collapsed .erp-nav-group-children {
  display: none;
}

.erp-logout-btn {
  gap: 10px;
}

.erp-logout-btn span {
  font-size: 15px;
}

.erp-sidebar.is-collapsed .erp-sidebar-footer {
  margin-top: 16px;
  padding-top: 14px;
}

.erp-sidebar.is-collapsed .erp-logout-btn {
  height: 44px;
  padding: 0;
}

.erp-sidebar.is-collapsed .erp-logout-btn span {
  display: block;
}

[data-theme="light"] .erp-sidebar,
[data-theme="light"] .erp-mobile-sidebar {
  background:
    radial-gradient(circle at top right, rgba(201, 166, 107, 0.16), transparent 22%),
    linear-gradient(180deg, #08172f 0%, #0b1f4d 100%);
}

[data-theme="light"] .erp-theme-toggle strong,
[data-theme="light"] .erp-brand-text h2,
[data-theme="light"] .erp-nav-item-label,
[data-theme="light"] .erp-logout-btn {
  color: #ffffff;
}

@media (max-width: 991px) {
  .erp-sidebar.is-collapsed {
    width: 88vw;
    min-width: auto;
    max-width: 360px;
    padding: 22px 16px 18px;
  }
}

.rp-loading-wrap {
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 78% 18%, rgba(245, 158, 11, 0.16), transparent 24%),
    radial-gradient(circle at 18% 82%, rgba(59, 130, 246, 0.10), transparent 26%),
    linear-gradient(135deg, #070b14 0%, #0c1224 52%, #070b14 100%);
}

.rp-loading-card {
  width: min(92vw, 420px);
  padding: 34px 30px;
  border-radius: 28px;
  background: rgba(12, 18, 36, 0.94);
  border: 1px solid rgba(245, 158, 11, 0.22);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
}

.rp-loading-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #070b14;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  box-shadow: 0 16px 32px rgba(245, 158, 11, 0.20);
}

.rp-loading-eyebrow {
  margin-bottom: 8px;
  color: #fbbf24;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-loading-title {
  color: #f8fafc;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.5;
}

.rp-loading-subtitle {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.8;
}

.rp-loading-spinner {
  width: 42px;
  height: 42px;
  margin: 22px auto 0;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.18);
  border-top-color: #f59e0b;
  border-left-color: rgba(245, 158, 11, 0.45);
  animation: rpSpin 0.8s linear infinite;
}

@keyframes rpSpin {
  to {
    transform: rotate(360deg);
  }
}

:root,
[data-theme="dark"],
[data-theme="light"] {
  --rp-bg: #0a1024;
  --rp-surface: #0c1224;
  --rp-text: #f8fafc;
  --rp-border: rgba(245, 158, 11, 0.12);
}

html,
body,
.erp-shell {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%) !important;
  color: #f8fafc !important;
}

.rp-theme-toggle {
  display: none !important;
}

.rp-group-icon svg,
.rp-nav-bullet svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rp-nav-bullet {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.45);
}

.rp-nav-item:hover .rp-nav-bullet {
  color: rgba(245, 158, 11, 0.82);
  background: rgba(245, 158, 11, 0.10);
}

.rp-nav-active .rp-nav-bullet {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.18);
}

.rp-nav-child .rp-nav-bullet {
  width: 22px;
  height: 22px;
}

.rp-nav-child .rp-nav-bullet svg {
  width: 14px;
  height: 14px;
}

.rp-group-icon {
  color: #fbbf24;
}

.rp-sidebar-collapsed .rp-nav-bullet {
  width: 32px;
  height: 32px;
}

.rp-sidebar-collapsed .rp-nav-bullet svg,
.rp-sidebar-collapsed .rp-group-icon svg {
  width: 18px;
  height: 18px;
}

.rp-dash-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  direction: rtl;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%);
  color: #f8fafc;
}

.rp-dash-main {
  flex: 1 1;
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(245, 158, 11, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  flex-wrap: wrap;
  gap: 12px;
}

.rp-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rp-topbar-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.24);
}

.rp-topbar-title {
  font-size: 14px;
  font-weight: 900;
  color: #f8fafc;
  line-height: 1.2;
}

.rp-topbar-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-topbar-center {
  display: flex;
  gap: 6px;
}

.rp-period-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rp-period-btn:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}

.rp-period-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(245, 158, 11, 0.08));
  border-color: rgba(245, 158, 11, 0.42);
  color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.10);
}

.rp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rp-icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rp-icon-btn:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.22);
  transform: translateY(-1px);
}

.rp-icon-btn.spinning {
  animation: rpSpin 0.8s linear infinite;
}

.rp-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.16);
}

.rp-clock-icon {
  font-size: 14px;
}

.rp-clock-text {
  color: #fbbf24;
  font-size: 11px;
  font-weight: 800;
}

.rp-hero {
  padding: 24px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 10% 10%, rgba(245, 158, 11, 0.16), transparent 26%),
    linear-gradient(135deg, rgba(12, 18, 36, 0.98), rgba(7, 11, 20, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.18);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

.rp-hero-eyebrow {
  color: #fbbf24;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.rp-hero-title {
  margin: 0;
  color: #fff;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 950;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.rp-hero-subtitle {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

.rp-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.rp-hero-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
}

.rp-hero-pill.success {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.22);
}

.rp-hero-pill.warning {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.22);
}

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

.rp-kpi-card {
  position: relative;
  min-height: 130px;
  padding: 18px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease;
  text-decoration: none;
  cursor: pointer;
}

.rp-kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--rp-kpi-color, rgba(245, 158, 11, 0.32));
}

.rp-kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.rp-kpi-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--rp-kpi-bg, rgba(245, 158, 11, 0.12));
  font-size: 18px;
}

.rp-kpi-trend {
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
}

.rp-kpi-trend.up { color: #4ade80; background: rgba(34, 197, 94, 0.12); }
.rp-kpi-trend.down { color: #f87171; background: rgba(239, 68, 68, 0.12); }
.rp-kpi-trend.flat { color: #94a3b8; background: rgba(148, 163, 184, 0.08); }

.rp-kpi-label {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  margin-top: 14px;
}

.rp-kpi-value {
  color: #f8fafc;
  font-size: 24px;
  font-weight: 950;
  margin-top: 6px;
  letter-spacing: -0.5px;
}

.rp-kpi-note {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}

.rp-kpi-spark {
  position: absolute;
  bottom: 10px;
  left: 14px;
  right: 14px;
  height: 40px;
  opacity: 0.55;
}

.rp-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 4px;
}

.rp-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rp-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
}

.rp-tab.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
  color: #fbbf24;
}

.rp-tab-badge {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 0 5px;
}

.rp-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-gap: 18px; gap: 18px; }
.rp-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 18px; gap: 18px; }
.rp-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-gap: 14px; gap: 14px; }

.rp-panel {
  padding: 18px;
  border-radius: 20px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.rp-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.rp-panel-title {
  margin: 0;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 900;
}

.rp-panel-sub {
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.rp-panel-tag {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.20);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 900;
}

.rp-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #64748b;
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.45);
  border: 1px dashed rgba(148, 163, 184, 0.18);
  font-size: 13px;
  font-weight: 700;
  grid-gap: 8px;
  gap: 8px;
}

.rp-empty-icon { font-size: 36px; }

.rp-product-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  grid-gap: 10px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.08);
  margin-bottom: 8px;
}

.rp-product-rank {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-weight: 950;
  font-size: 12px;
}

.rp-product-name {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-product-meta {
  text-align: left;
}

.rp-product-revenue { color: #4ade80; font-size: 12px; font-weight: 900; }
.rp-product-qty { color: #64748b; font-size: 10px; font-weight: 700; margin-top: 2px; }

.rp-insight {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 8px;
  border: 1px solid transparent;
}

.rp-insight.success { background: rgba(34, 197, 94, 0.06); border-color: rgba(34, 197, 94, 0.18); }
.rp-insight.warning { background: rgba(245, 158, 11, 0.06); border-color: rgba(245, 158, 11, 0.18); }
.rp-insight.danger { background: rgba(239, 68, 68, 0.06); border-color: rgba(239, 68, 68, 0.18); }
.rp-insight.info { background: rgba(59, 130, 246, 0.06); border-color: rgba(59, 130, 246, 0.18); }

.rp-insight-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.rp-insight-title { color: #f8fafc; font-size: 13px; font-weight: 900; }
.rp-insight-desc { margin: 4px 0 0; color: #94a3b8; font-size: 11px; font-weight: 600; line-height: 1.7; }

.rp-feed-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.rp-feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18);
  margin-top: 6px;
  flex-shrink: 0;
}

.rp-feed-title { color: #f8fafc; font-size: 12px; font-weight: 800; }
.rp-feed-meta { color: #64748b; font-size: 10px; font-weight: 600; margin-top: 3px; }

.rp-factory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  grid-gap: 14px;
  gap: 14px;
}

.rp-factory-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.10);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.rp-factory-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.24);
}

.rp-factory-head { display: flex; justify-content: space-between; align-items: center; }
.rp-factory-icon { font-size: 22px; }
.rp-factory-status { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.rp-factory-status.active { color: #4ade80; background: rgba(34, 197, 94, 0.10); }
.rp-factory-status.inactive { color: #f87171; background: rgba(239, 68, 68, 0.10); }
.rp-factory-name { color: #f8fafc; font-size: 13px; font-weight: 900; margin: 10px 0 0; }
.rp-factory-stats { display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 10px; gap: 10px; margin-top: 14px; }
.rp-factory-stat-label { color: #64748b; font-size: 10px; font-weight: 700; }
.rp-factory-stat-value { color: #f8fafc; font-size: 18px; font-weight: 950; }

.rp-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.rp-quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.10);
  text-decoration: none;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.rp-quick-link:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.28);
}

.rp-quick-icon { font-size: 20px; }

.rp-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.08);
  flex-wrap: wrap;
  gap: 10px;
}

.rp-status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.rp-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.rp-fade-in { animation: rpFadeIn 0.35s ease-out; }

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

@keyframes rpSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1200px) {
  .rp-grid-2, .rp-grid-3, .rp-grid-4 { grid-template-columns: 1fr; }
  .rp-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .rp-dash-main { padding: 16px; }
  .rp-kpi-grid { grid-template-columns: 1fr; }
  .rp-topbar { flex-direction: column; align-items: stretch; }
  .rp-topbar-center { justify-content: center; flex-wrap: wrap; }
  .rp-topbar-actions { justify-content: center; }
  .rp-quick-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== Royal Palace Sidebar Pro v2 ========== */
.rp-sidebar {
  width: 290px;
  min-width: 290px;
  max-width: 290px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0a1024 0%, #060916 100%);
  color: #f1f5f9;
  padding: 18px 14px;
  flex-shrink: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  align-self: flex-start;
  border-left: 1px solid rgba(245, 158, 11, 0.10);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.3) transparent;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-sidebar::-webkit-scrollbar { width: 6px; }
.rp-sidebar::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 999px;
}
.rp-sidebar::-webkit-scrollbar-track { background: transparent; }

.rp-sidebar-collapsed {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  padding: 18px 8px;
}

.rp-sidebar-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-sidebar-brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.32),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.rp-brand-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  border: 2px solid rgba(245, 158, 11, 0.5);
  opacity: 0;
  animation: rpBrandPulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes rpBrandPulse {
  0% { opacity: 0.7; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.18); }
}

.rp-sidebar-brand-text {
  flex: 1 1;
  min-width: 0;
}

.rp-sidebar-brand-text h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.rp-sidebar-brand-text p {
  margin: 3px 0 0;
  font-size: 10px;
  color: rgba(245, 158, 11, 0.85);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-collapse-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  transform: translateX(-2px);
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.rp-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.rp-search-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  pointer-events: none;
}

.rp-search-input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  padding: 0 30px 0 30px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.rp-search-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.rp-search-wrap.focused .rp-search-input {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.06);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.rp-search-clear {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.rp-search-clear:hover { background: rgba(239, 68, 68, 0.3); }

.rp-sidebar-current {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.rp-sidebar-current-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.rp-sidebar-current-value {
  font-size: 13px;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: -0.2px;
}

.rp-sidebar-profile {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-profile-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.32);
}

.rp-profile-status {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0a1024;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.rp-profile-info {
  flex: 1 1;
  min-width: 0;
}

.rp-profile-name {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-profile-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  margin-top: 2px;
}

.rp-profile-key { color: rgba(255, 255, 255, 0.55); font-weight: 700; }
.rp-profile-row strong { color: #fbbf24; font-weight: 800; font-size: 10px; }

.rp-theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  margin-bottom: 12px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  justify-content: center;
}

.rp-theme-toggle:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
  transform: translateY(-1px);
}

.rp-theme-icon {
  font-size: 16px;
  line-height: 1;
}

.rp-sidebar-collapsed .rp-theme-toggle {
  padding: 0;
  height: 42px;
}

.rp-sidebar-section-title {
  margin: 14px 0 8px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rp-nav {
  display: grid;
  grid-gap: 3px;
  gap: 3px;
}

.rp-nav-group {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  margin-bottom: 4px;
}

.rp-nav-group-body {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  padding: 4px 0 6px 0;
  margin-right: 4px;
  border-right: 2px solid rgba(245, 158, 11, 0.14);
  animation: rpFadeSlide 0.22s ease-out;
}

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

.rp-nav-item,
.rp-nav-group-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-nav-item:hover,
.rp-nav-group-head:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  transform: translateX(-2px);
}

.rp-nav-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(245, 158, 11, 0.06));
  border-color: rgba(245, 158, 11, 0.34);
  color: #fbbf24 !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rp-nav-active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: -14px;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.rp-sidebar-collapsed .rp-nav-active::before {
  right: -8px;
}

.rp-nav-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-item:hover .rp-nav-bullet { background: rgba(245, 158, 11, 0.6); }
.rp-nav-active .rp-nav-bullet {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.rp-nav-child .rp-nav-bullet { width: 4px; height: 4px; }

.rp-group-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-group-head:hover .rp-group-icon {
  background: rgba(245, 158, 11, 0.16);
  transform: scale(1.05);
}

.rp-group-open .rp-group-icon {
  background: rgba(245, 158, 11, 0.14);
}

.rp-nav-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1;
  min-width: 0;
}

.rp-nav-label {
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-active .rp-nav-hint { color: rgba(251, 191, 36, 0.7); }

.rp-nav-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
  flex-shrink: 0;
  animation: rpDotPulse 1.6s ease-in-out infinite;
}

@keyframes rpDotPulse {
  50% { opacity: 0.5; transform: scale(0.85); }
}

.rp-chevron {
  font-weight: 900;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.rp-chevron.open { transform: rotate(90deg); color: #fbbf24; }

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  padding: 10px;
  justify-content: center;
}

.rp-sidebar-collapsed .rp-nav-bullet { display: none; }
.rp-sidebar-collapsed .rp-group-icon {
  width: 32px; height: 32px; font-size: 16px;
}

.rp-nav-empty {
  text-align: center;
  padding: 30px 14px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 700;
}

.rp-sidebar-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-logout-btn {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.rp-logout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.42);
  transform: translateY(-1px);
}

.rp-logout-icon { font-size: 16px; }

.rp-sidebar-version {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
}

.rp-status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: rpDotPulse 2s ease-in-out infinite;
}

.rp-mobile-menu-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1400;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.32);
}

.rp-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 1498;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: rpFadeIn 0.22s ease-out;
}

.rp-sidebar-mobile {
  position: fixed;
  top: 0;
  right: 0;
  width: 88vw;
  max-width: 340px;
  height: 100vh;
  z-index: 1499;
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.55);
  animation: rpSlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rpSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.rp-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rp-mobile-title {
  font-size: 16px;
  font-weight: 900;
  color: #fbbf24;
}

.rp-mobile-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 991px) {
  .rp-sidebar { display: none; }
  .erp-shell { display: block; }
  .erp-main, .rp-dash-main { padding-top: 80px; }
}

[data-theme="dark"] {
  --rp-bg: #0a1024;
  --rp-surface: #0c1224;
  --rp-text: #f8fafc;
  --rp-border: rgba(245, 158, 11, 0.12);
}

.rp-dash-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  direction: rtl;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%);
  color: #f8fafc;
}

.rp-dash-main {
  flex: 1 1;
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(245, 158, 11, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  flex-wrap: wrap;
  gap: 12px;
}

.rp-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rp-topbar-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.24);
}

.rp-topbar-title {
  font-size: 14px;
  font-weight: 900;
  color: #f8fafc;
  line-height: 1.2;
}

.rp-topbar-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-topbar-center {
  display: flex;
  gap: 6px;
}

.rp-period-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rp-period-btn:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}

.rp-period-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(245, 158, 11, 0.08));
  border-color: rgba(245, 158, 11, 0.42);
  color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.10);
}

.rp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rp-icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rp-icon-btn:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.22);
  transform: translateY(-1px);
}

.rp-icon-btn.spinning {
  animation: rpSpin 0.8s linear infinite;
}

.rp-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.16);
}

.rp-clock-icon {
  font-size: 14px;
}

.rp-clock-text {
  color: #fbbf24;
  font-size: 11px;
  font-weight: 800;
}

.rp-hero {
  padding: 24px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 10% 10%, rgba(245, 158, 11, 0.16), transparent 26%),
    linear-gradient(135deg, rgba(12, 18, 36, 0.98), rgba(7, 11, 20, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.18);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

.rp-hero-eyebrow {
  color: #fbbf24;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.rp-hero-title {
  margin: 0;
  color: #fff;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 950;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.rp-hero-subtitle {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

.rp-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.rp-hero-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
}

.rp-hero-pill.success {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.22);
}

.rp-hero-pill.warning {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.22);
}

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

.rp-kpi-card {
  position: relative;
  min-height: 130px;
  padding: 18px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease;
  text-decoration: none;
  cursor: pointer;
}

.rp-kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--rp-kpi-color, rgba(245, 158, 11, 0.32));
}

.rp-kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.rp-kpi-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--rp-kpi-bg, rgba(245, 158, 11, 0.12));
  font-size: 18px;
}

.rp-kpi-trend {
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
}

.rp-kpi-trend.up { color: #4ade80; background: rgba(34, 197, 94, 0.12); }
.rp-kpi-trend.down { color: #f87171; background: rgba(239, 68, 68, 0.12); }
.rp-kpi-trend.flat { color: #94a3b8; background: rgba(148, 163, 184, 0.08); }

.rp-kpi-label {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  margin-top: 14px;
}

.rp-kpi-value {
  color: #f8fafc;
  font-size: 24px;
  font-weight: 950;
  margin-top: 6px;
  letter-spacing: -0.5px;
}

.rp-kpi-note {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}

.rp-kpi-spark {
  position: absolute;
  bottom: 10px;
  left: 14px;
  right: 14px;
  height: 40px;
  opacity: 0.55;
}

.rp-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 4px;
}

.rp-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rp-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
}

.rp-tab.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
  color: #fbbf24;
}

.rp-tab-badge {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 0 5px;
}

.rp-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-gap: 18px; gap: 18px; }
.rp-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 18px; gap: 18px; }
.rp-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-gap: 14px; gap: 14px; }

.rp-panel {
  padding: 18px;
  border-radius: 20px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.rp-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.rp-panel-title {
  margin: 0;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 900;
}

.rp-panel-sub {
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.rp-panel-tag {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.20);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 900;
}

.rp-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #64748b;
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.45);
  border: 1px dashed rgba(148, 163, 184, 0.18);
  font-size: 13px;
  font-weight: 700;
  grid-gap: 8px;
  gap: 8px;
}

.rp-empty-icon { font-size: 36px; }

.rp-product-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  grid-gap: 10px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.08);
  margin-bottom: 8px;
}

.rp-product-rank {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-weight: 950;
  font-size: 12px;
}

.rp-product-name {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-product-meta {
  text-align: left;
}

.rp-product-revenue { color: #4ade80; font-size: 12px; font-weight: 900; }
.rp-product-qty { color: #64748b; font-size: 10px; font-weight: 700; margin-top: 2px; }

.rp-insight {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 8px;
  border: 1px solid transparent;
}

.rp-insight.success { background: rgba(34, 197, 94, 0.06); border-color: rgba(34, 197, 94, 0.18); }
.rp-insight.warning { background: rgba(245, 158, 11, 0.06); border-color: rgba(245, 158, 11, 0.18); }
.rp-insight.danger { background: rgba(239, 68, 68, 0.06); border-color: rgba(239, 68, 68, 0.18); }
.rp-insight.info { background: rgba(59, 130, 246, 0.06); border-color: rgba(59, 130, 246, 0.18); }

.rp-insight-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.rp-insight-title { color: #f8fafc; font-size: 13px; font-weight: 900; }
.rp-insight-desc { margin: 4px 0 0; color: #94a3b8; font-size: 11px; font-weight: 600; line-height: 1.7; }

.rp-feed-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.rp-feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18);
  margin-top: 6px;
  flex-shrink: 0;
}

.rp-feed-title { color: #f8fafc; font-size: 12px; font-weight: 800; }
.rp-feed-meta { color: #64748b; font-size: 10px; font-weight: 600; margin-top: 3px; }

.rp-factory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  grid-gap: 14px;
  gap: 14px;
}

.rp-factory-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.10);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.rp-factory-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.24);
}

.rp-factory-head { display: flex; justify-content: space-between; align-items: center; }
.rp-factory-icon { font-size: 22px; }
.rp-factory-status { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.rp-factory-status.active { color: #4ade80; background: rgba(34, 197, 94, 0.10); }
.rp-factory-status.inactive { color: #f87171; background: rgba(239, 68, 68, 0.10); }
.rp-factory-name { color: #f8fafc; font-size: 13px; font-weight: 900; margin: 10px 0 0; }
.rp-factory-stats { display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 10px; gap: 10px; margin-top: 14px; }
.rp-factory-stat-label { color: #64748b; font-size: 10px; font-weight: 700; }
.rp-factory-stat-value { color: #f8fafc; font-size: 18px; font-weight: 950; }

.rp-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.rp-quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.10);
  text-decoration: none;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.rp-quick-link:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.28);
}

.rp-quick-icon { font-size: 20px; }

.rp-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.08);
  flex-wrap: wrap;
  gap: 10px;
}

.rp-status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.rp-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.rp-fade-in { animation: rpFadeIn 0.35s ease-out; }

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

@keyframes rpSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1200px) {
  .rp-grid-2, .rp-grid-3, .rp-grid-4 { grid-template-columns: 1fr; }
  .rp-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .rp-dash-main { padding: 16px; }
  .rp-kpi-grid { grid-template-columns: 1fr; }
  .rp-topbar { flex-direction: column; align-items: stretch; }
  .rp-topbar-center { justify-content: center; flex-wrap: wrap; }
  .rp-topbar-actions { justify-content: center; }
  .rp-quick-grid { grid-template-columns: repeat(2, 1fr); }
}

.rp-dash-shell {
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: row !important;
  direction: rtl !important;
  background: radial-gradient(circle at top right, rgba(245,158,11,0.08), transparent 20%), linear-gradient(180deg, #070b14 0%, #0c1224 100%) !important;
  color: #f8fafc !important;
  visibility: visible !important;
  overflow: visible !important;
}

.rp-dash-main {
  flex: 1 1 !important;
  min-width: 0 !important;
  min-height: 100vh !important;
  padding: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  visibility: visible !important;
  overflow: visible !important;
}

.rp-dash-main > * {
  visibility: visible !important;
}

.rp-topbar, .rp-hero, .rp-kpi-grid, .rp-tabs, .rp-panel, .rp-grid-2, .rp-grid-3, .rp-grid-4, .rp-status-bar {
  display: block !important;
  visibility: visible !important;
}

.rp-kpi-grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important; grid-gap: 14px !important; gap: 14px !important; }
.rp-grid-2 { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; grid-gap: 18px !important; gap: 18px !important; }
.rp-grid-3 { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; grid-gap: 18px !important; gap: 18px !important; }
.rp-grid-4 { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; grid-gap: 14px !important; gap: 14px !important; }

.rp-fade-in { opacity: 1 !important; transform: none !important; }

@media (max-width: 1200px) {
  .rp-grid-2, .rp-grid-3, .rp-grid-4 { grid-template-columns: 1fr !important; }
  .rp-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 760px) {
  .rp-dash-main { padding: 16px !important; }
  .rp-kpi-grid { grid-template-columns: 1fr !important; }
}

html,
html[data-theme="dark"],
html[data-theme="light"] {
  --rp-bg: #070b14;
  --rp-bg-soft: #0c1224;
  --rp-surface: #0c1224;
  --rp-surface-2: #070b14;
  --rp-border: #1e293b;
  --rp-border-strong: #334155;
  --rp-text: #f8fafc;
  --rp-text-soft: #cbd5e1;
  --rp-text-muted: #64748b;
  --rp-gold: #fbbf24;
  --rp-gold-strong: #f59e0b;
  color-scheme: dark;
}

body,
.erp-shell,
.rp-dash-shell {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%) !important;
  color: #f8fafc !important;
}

.rp-theme-toggle {
  display: none !important;
}

.rp-dash-main,
.rp-panel,
.rp-kpi-card,
.rp-topbar,
.rp-hero {
  color: #f8fafc;
}

/* ========== Dashboard Topbar Layout Fix ========== */
.rp-topbar {
  display: grid !important;
  grid-template-columns: auto minmax(260px, 1fr) auto !important;
  grid-template-areas: "actions periods brand" !important;
  align-items: center !important;
  grid-gap: 16px !important;
  gap: 16px !important;
  min-height: 86px !important;
  padding: 14px 18px !important;
  overflow: visible !important;
}

.rp-topbar-brand {
  grid-area: brand !important;
  justify-self: end !important;
  direction: rtl !important;
  min-width: 250px !important;
}

.rp-topbar-center {
  grid-area: periods !important;
  justify-self: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.rp-topbar-actions {
  grid-area: actions !important;
  justify-self: start !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  min-width: max-content !important;
}

.rp-period-btn {
  white-space: nowrap !important;
  min-width: 56px !important;
}

.rp-icon-btn {
  flex: 0 0 auto !important;
}

.rp-clock {
  flex: 0 0 auto !important;
  min-width: 74px !important;
  justify-content: center !important;
}

@media (max-width: 1180px) {
  .rp-topbar {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "brand"
      "periods"
      "actions" !important;
    min-height: auto !important;
    padding: 16px !important;
  }

  .rp-topbar-brand,
  .rp-topbar-center,
  .rp-topbar-actions {
    justify-self: center !important;
  }

  .rp-topbar-brand {
    min-width: 0 !important;
    text-align: center !important;
  }

  .rp-topbar-center,
  .rp-topbar-actions {
    flex-wrap: wrap !important;
  }
}

@media (max-width: 640px) {
  .rp-topbar-center {
    width: 100% !important;
  }

  .rp-period-btn {
    flex: 1 1 70px !important;
  }

  .rp-topbar-actions {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ========== Royal Palace Sidebar Collapse Polish ========== */
.rp-sidebar.rp-sidebar-collapsed {
  width: 76px !important;
  min-width: 76px !important;
  max-width: 76px !important;
  padding: 16px 8px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px !important;
}

.rp-sidebar-collapsed .rp-sidebar-brand {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  place-items: center !important;
  grid-gap: 10px !important;
  gap: 10px !important;
  padding: 0 0 14px !important;
  margin-bottom: 8px !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

.rp-sidebar-collapsed .rp-sidebar-brand-mark {
  width: 48px !important;
  height: 48px !important;
  border-radius: 16px !important;
  font-size: 15px !important;
  margin-top: 36px !important;
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute !important;
  top: 12px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 36px !important;
  height: 30px !important;
  border-radius: 12px !important;
  z-index: 5 !important;
  background: rgba(245, 158, 11, 0.13) !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
  color: #fbbf24 !important;
}

.rp-sidebar-collapsed .rp-collapse-btn:hover {
  transform: translateX(-50%) translateY(-1px) !important;
  background: rgba(245, 158, 11, 0.22) !important;
}

.rp-sidebar-collapsed .rp-search-wrap,
.rp-sidebar-collapsed .rp-sidebar-current,
.rp-sidebar-collapsed .rp-sidebar-profile,
.rp-sidebar-collapsed .rp-sidebar-section-title,
.rp-sidebar-collapsed .rp-sidebar-version,
.rp-sidebar-collapsed .rp-nav-text,
.rp-sidebar-collapsed .rp-chevron,
.rp-sidebar-collapsed .rp-nav-active-dot,
.rp-sidebar-collapsed .rp-nav-group-body {
  display: none !important;
}

.rp-sidebar-collapsed .rp-nav {
  width: 100% !important;
  display: grid !important;
  grid-gap: 9px !important;
  gap: 9px !important;
  justify-items: center !important;
  margin-top: 2px !important;
}

.rp-sidebar-collapsed .rp-nav-group {
  width: 100% !important;
  display: grid !important;
  justify-items: center !important;
  margin: 0 !important;
}

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,0.045) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  transform: none !important;
}

.rp-sidebar-collapsed .rp-nav-item:hover,
.rp-sidebar-collapsed .rp-nav-group-head:hover {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.24) !important;
  transform: translateY(-1px) !important;
}

.rp-sidebar-collapsed .rp-group-icon,
.rp-sidebar-collapsed .rp-nav-bullet {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 12px !important;
  background: rgba(245, 158, 11, 0.08) !important;
  color: #fbbf24 !important;
  font-size: 16px !important;
  box-shadow: none !important;
}

.rp-sidebar-collapsed .rp-nav-bullet svg,
.rp-sidebar-collapsed .rp-group-icon svg {
  width: 18px !important;
  height: 18px !important;
}

.rp-sidebar-collapsed .rp-nav-active {
  background: linear-gradient(135deg, rgba(245,158,11,0.22), rgba(245,158,11,0.08)) !important;
  border-color: rgba(245,158,11,0.40) !important;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.12) !important;
}

.rp-sidebar-collapsed .rp-nav-active::before {
  content: "" !important;
  position: absolute !important;
  top: 10px !important;
  bottom: 10px !important;
  right: -8px !important;
  width: 3px !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #f59e0b, #fbbf24) !important;
  box-shadow: 0 0 12px rgba(245,158,11,0.45) !important;
}

.rp-sidebar-collapsed .rp-sidebar-footer {
  width: 100% !important;
  margin-top: auto !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  display: grid !important;
  place-items: center !important;
}

.rp-sidebar-collapsed .rp-logout-btn {
  width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 !important;
  border-radius: 16px !important;
  display: grid !important;
  place-items: center !important;
}

.rp-sidebar-collapsed .rp-logout-btn span:not(.rp-logout-icon) {
  display: none !important;
}

.rp-sidebar-collapsed .rp-logout-icon {
  font-size: 18px !important;
}

.rp-sidebar-collapsed .rp-brand-pulse {
  display: none !important;
}

/* ===== Collapsed Sidebar Fix ===== */
.rp-sidebar-collapsed .rp-sidebar-brand {
  justify-content: center;
  padding: 6px 4px 14px;
}

.rp-sidebar-collapsed .rp-sidebar-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.rp-sidebar-collapsed .rp-search-wrap,
.rp-sidebar-collapsed .rp-sidebar-current,
.rp-sidebar-collapsed .rp-sidebar-profile,
.rp-sidebar-collapsed .rp-theme-toggle,
.rp-sidebar-collapsed .rp-sidebar-section-title,
.rp-sidebar-collapsed .rp-nav-hint,
.rp-sidebar-collapsed .rp-nav-label,
.rp-sidebar-collapsed .rp-nav-text,
.rp-sidebar-collapsed .rp-chevron,
.rp-sidebar-collapsed .rp-sidebar-version,
.rp-sidebar-collapsed .rp-nav-empty {
  display: none !important;
}

.rp-sidebar-collapsed .rp-nav {
  gap: 4px;
}

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  padding: 10px 0 !important;
  justify-content: center !important;
  min-height: 42px !important;
  margin: 0 !important;
  border-radius: 10px !important;
}

.rp-sidebar-collapsed .rp-nav-bullet {
  width: 32px !important;
  height: 32px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.55) !important;
}

.rp-sidebar-collapsed .rp-nav-bullet svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2.2 !important;
}

.rp-sidebar-collapsed .rp-nav-item:hover .rp-nav-bullet,
.rp-sidebar-collapsed .rp-nav-group-head:hover .rp-nav-bullet {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #fbbf24 !important;
}

.rp-sidebar-collapsed .rp-nav-active .rp-nav-bullet {
  background: rgba(245, 158, 11, 0.20) !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.24) !important;
}

.rp-sidebar-collapsed .rp-group-icon {
  display: none !important;
}

.rp-sidebar-collapsed .rp-nav-group {
  margin-bottom: 4px;
}

.rp-sidebar-collapsed .rp-nav-group-body {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

.rp-sidebar-collapsed .rp-nav-child {
  display: none !important;
}

.rp-sidebar-collapsed .rp-sidebar-footer {
  margin-top: 12px;
  padding-top: 12px;
}

.rp-sidebar-collapsed .rp-logout-btn {
  height: 40px !important;
  padding: 0 !important;
  justify-content: center !important;
  border-radius: 10px !important;
}

.rp-sidebar-collapsed .rp-logout-btn span:not(.rp-logout-icon) {
  display: none !important;
}

.rp-sidebar-collapsed .rp-logout-icon {
  font-size: 16px !important;
}

/* ===== Topbar Fix ===== */
.rp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(245, 158, 11, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  flex-wrap: nowrap;
  gap: 16px;
  min-height: 62px;
}

.rp-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.rp-topbar-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.rp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .rp-topbar { flex-wrap: wrap; justify-content: center; }
  .rp-topbar-brand { flex: 0 0 100%; justify-content: center; margin-bottom: 8px; }
  .rp-topbar-center { flex: 0 0 100%; justify-content: center; margin-bottom: 8px; }
  .rp-topbar-actions { flex: 0 0 100%; justify-content: center; }
}

/* ========== Royal Palace Sidebar Pro v2 ========== */
.rp-sidebar {
  width: 290px;
  min-width: 290px;
  max-width: 290px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0a1024 0%, #060916 100%);
  color: #f1f5f9;
  padding: 18px 14px;
  flex-shrink: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  align-self: flex-start;
  border-left: 1px solid rgba(245, 158, 11, 0.10);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.3) transparent;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-sidebar::-webkit-scrollbar { width: 6px; }
.rp-sidebar::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 999px;
}
.rp-sidebar::-webkit-scrollbar-track { background: transparent; }

.rp-sidebar-collapsed {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  padding: 18px 8px;
}

.rp-sidebar-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-sidebar-brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.32),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.rp-brand-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  border: 2px solid rgba(245, 158, 11, 0.5);
  opacity: 0;
  animation: rpBrandPulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes rpBrandPulse {
  0% { opacity: 0.7; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.18); }
}

.rp-sidebar-brand-text {
  flex: 1 1;
  min-width: 0;
}

.rp-sidebar-brand-text h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.rp-sidebar-brand-text p {
  margin: 3px 0 0;
  font-size: 10px;
  color: rgba(245, 158, 11, 0.85);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-collapse-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  transform: translateX(-2px);
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.rp-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.rp-search-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  pointer-events: none;
}

.rp-search-input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  padding: 0 30px 0 30px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.rp-search-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.rp-search-wrap.focused .rp-search-input {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.06);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.rp-search-clear {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.rp-search-clear:hover { background: rgba(239, 68, 68, 0.3); }

.rp-sidebar-current {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.rp-sidebar-current-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.rp-sidebar-current-value {
  font-size: 13px;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: -0.2px;
}

.rp-sidebar-profile {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-profile-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.32);
}

.rp-profile-status {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0a1024;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.rp-profile-info {
  flex: 1 1;
  min-width: 0;
}

.rp-profile-name {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-profile-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  margin-top: 2px;
}

.rp-profile-key { color: rgba(255, 255, 255, 0.55); font-weight: 700; }
.rp-profile-row strong { color: #fbbf24; font-weight: 800; font-size: 10px; }

.rp-theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  margin-bottom: 12px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  justify-content: center;
}

.rp-theme-toggle:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
  transform: translateY(-1px);
}

.rp-theme-icon {
  font-size: 16px;
  line-height: 1;
}

.rp-sidebar-collapsed .rp-theme-toggle {
  padding: 0;
  height: 42px;
}

.rp-sidebar-section-title {
  margin: 14px 0 8px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rp-nav {
  display: grid;
  grid-gap: 3px;
  gap: 3px;
}

.rp-nav-group {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  margin-bottom: 4px;
}

.rp-nav-group-body {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  padding: 4px 0 6px 0;
  margin-right: 4px;
  border-right: 2px solid rgba(245, 158, 11, 0.14);
  animation: rpFadeSlide 0.22s ease-out;
}

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

.rp-nav-item,
.rp-nav-group-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-nav-item:hover,
.rp-nav-group-head:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  transform: translateX(-2px);
}

.rp-nav-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(245, 158, 11, 0.06));
  border-color: rgba(245, 158, 11, 0.34);
  color: #fbbf24 !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rp-nav-active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: -14px;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.rp-sidebar-collapsed .rp-nav-active::before {
  right: -8px;
}

.rp-nav-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-item:hover .rp-nav-bullet { background: rgba(245, 158, 11, 0.6); }
.rp-nav-active .rp-nav-bullet {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.rp-nav-child .rp-nav-bullet { width: 4px; height: 4px; }

.rp-group-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-group-head:hover .rp-group-icon {
  background: rgba(245, 158, 11, 0.16);
  transform: scale(1.05);
}

.rp-group-open .rp-group-icon {
  background: rgba(245, 158, 11, 0.14);
}

.rp-nav-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1;
  min-width: 0;
}

.rp-nav-label {
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-active .rp-nav-hint { color: rgba(251, 191, 36, 0.7); }

.rp-nav-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
  flex-shrink: 0;
  animation: rpDotPulse 1.6s ease-in-out infinite;
}

@keyframes rpDotPulse {
  50% { opacity: 0.5; transform: scale(0.85); }
}

.rp-chevron {
  font-weight: 900;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.rp-chevron.open { transform: rotate(90deg); color: #fbbf24; }

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  padding: 10px;
  justify-content: center;
}

.rp-sidebar-collapsed .rp-nav-bullet { display: none; }
.rp-sidebar-collapsed .rp-group-icon {
  width: 32px; height: 32px; font-size: 16px;
}

.rp-nav-empty {
  text-align: center;
  padding: 30px 14px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 700;
}

.rp-sidebar-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-logout-btn {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.rp-logout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.42);
  transform: translateY(-1px);
}

.rp-logout-icon { font-size: 16px; }

.rp-sidebar-version {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
}

.rp-status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: rpDotPulse 2s ease-in-out infinite;
}

.rp-mobile-menu-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1400;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.32);
}

.rp-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 1498;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: rpFadeIn 0.22s ease-out;
}

.rp-sidebar-mobile {
  position: fixed;
  top: 0;
  right: 0;
  width: 88vw;
  max-width: 340px;
  height: 100vh;
  z-index: 1499;
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.55);
  animation: rpSlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rpSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.rp-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rp-mobile-title {
  font-size: 16px;
  font-weight: 900;
  color: #fbbf24;
}

.rp-mobile-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 991px) {
  .rp-sidebar { display: none; }
  .erp-shell { display: block; }
  .erp-main, .rp-dash-main { padding-top: 80px; }
}

[data-theme="dark"] {
  --rp-bg: #0a1024;
  --rp-surface: #0c1224;
  --rp-text: #f8fafc;
  --rp-border: rgba(245, 158, 11, 0.12);
}

/* ========== Royal Palace Sidebar Collapse Polish ========== */
.rp-sidebar.rp-sidebar-collapsed {
  width: 76px !important;
  min-width: 76px !important;
  max-width: 76px !important;
  padding: 16px 8px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px !important;
}

.rp-sidebar-collapsed .rp-sidebar-brand {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  place-items: center !important;
  grid-gap: 10px !important;
  gap: 10px !important;
  padding: 0 0 14px !important;
  margin-bottom: 8px !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

.rp-sidebar-collapsed .rp-sidebar-brand-mark {
  width: 48px !important;
  height: 48px !important;
  border-radius: 16px !important;
  font-size: 15px !important;
  margin-top: 36px !important;
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute !important;
  top: 12px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 36px !important;
  height: 30px !important;
  border-radius: 12px !important;
  z-index: 5 !important;
  background: rgba(245, 158, 11, 0.13) !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
  color: #fbbf24 !important;
}

.rp-sidebar-collapsed .rp-collapse-btn:hover {
  transform: translateX(-50%) translateY(-1px) !important;
  background: rgba(245, 158, 11, 0.22) !important;
}

.rp-sidebar-collapsed .rp-search-wrap,
.rp-sidebar-collapsed .rp-sidebar-current,
.rp-sidebar-collapsed .rp-sidebar-profile,
.rp-sidebar-collapsed .rp-sidebar-section-title,
.rp-sidebar-collapsed .rp-sidebar-version,
.rp-sidebar-collapsed .rp-nav-text,
.rp-sidebar-collapsed .rp-chevron,
.rp-sidebar-collapsed .rp-nav-active-dot,
.rp-sidebar-collapsed .rp-nav-group-body {
  display: none !important;
}

.rp-sidebar-collapsed .rp-nav {
  width: 100% !important;
  display: grid !important;
  grid-gap: 9px !important;
  gap: 9px !important;
  justify-items: center !important;
  margin-top: 2px !important;
}

.rp-sidebar-collapsed .rp-nav-group {
  width: 100% !important;
  display: grid !important;
  justify-items: center !important;
  margin: 0 !important;
}

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,0.045) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  transform: none !important;
}

.rp-sidebar-collapsed .rp-nav-item:hover,
.rp-sidebar-collapsed .rp-nav-group-head:hover {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.24) !important;
  transform: translateY(-1px) !important;
}

.rp-sidebar-collapsed .rp-group-icon,
.rp-sidebar-collapsed .rp-nav-bullet {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 12px !important;
  background: rgba(245, 158, 11, 0.08) !important;
  color: #fbbf24 !important;
  font-size: 16px !important;
  box-shadow: none !important;
}

.rp-sidebar-collapsed .rp-nav-bullet svg,
.rp-sidebar-collapsed .rp-group-icon svg {
  width: 18px !important;
  height: 18px !important;
}

.rp-sidebar-collapsed .rp-nav-active {
  background: linear-gradient(135deg, rgba(245,158,11,0.22), rgba(245,158,11,0.08)) !important;
  border-color: rgba(245,158,11,0.40) !important;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.12) !important;
}

.rp-sidebar-collapsed .rp-nav-active::before {
  content: "" !important;
  position: absolute !important;
  top: 10px !important;
  bottom: 10px !important;
  right: -8px !important;
  width: 3px !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #f59e0b, #fbbf24) !important;
  box-shadow: 0 0 12px rgba(245,158,11,0.45) !important;
}

.rp-sidebar-collapsed .rp-sidebar-footer {
  width: 100% !important;
  margin-top: auto !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  display: grid !important;
  place-items: center !important;
}

.rp-sidebar-collapsed .rp-logout-btn {
  width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 !important;
  border-radius: 16px !important;
  display: grid !important;
  place-items: center !important;
}

.rp-sidebar-collapsed .rp-logout-btn span:not(.rp-logout-icon) {
  display: none !important;
}

.rp-sidebar-collapsed .rp-logout-icon {
  font-size: 18px !important;
}

.rp-sidebar-collapsed .rp-brand-pulse {
  display: none !important;
}

/* ===== Collapsed Sidebar Fix ===== */
.rp-sidebar-collapsed .rp-sidebar-brand {
  justify-content: center;
  padding: 6px 4px 14px;
}

.rp-sidebar-collapsed .rp-sidebar-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.rp-sidebar-collapsed .rp-search-wrap,
.rp-sidebar-collapsed .rp-sidebar-current,
.rp-sidebar-collapsed .rp-sidebar-profile,
.rp-sidebar-collapsed .rp-theme-toggle,
.rp-sidebar-collapsed .rp-sidebar-section-title,
.rp-sidebar-collapsed .rp-nav-hint,
.rp-sidebar-collapsed .rp-nav-label,
.rp-sidebar-collapsed .rp-nav-text,
.rp-sidebar-collapsed .rp-chevron,
.rp-sidebar-collapsed .rp-sidebar-version,
.rp-sidebar-collapsed .rp-nav-empty {
  display: none !important;
}

.rp-sidebar-collapsed .rp-nav {
  gap: 4px;
}

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  padding: 10px 0 !important;
  justify-content: center !important;
  min-height: 42px !important;
  margin: 0 !important;
  border-radius: 10px !important;
}

.rp-sidebar-collapsed .rp-nav-bullet {
  width: 32px !important;
  height: 32px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.55) !important;
}

.rp-sidebar-collapsed .rp-nav-bullet svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2.2 !important;
}

.rp-sidebar-collapsed .rp-nav-item:hover .rp-nav-bullet,
.rp-sidebar-collapsed .rp-nav-group-head:hover .rp-nav-bullet {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #fbbf24 !important;
}

.rp-sidebar-collapsed .rp-nav-active .rp-nav-bullet {
  background: rgba(245, 158, 11, 0.20) !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.24) !important;
}

.rp-sidebar-collapsed .rp-group-icon {
  display: none !important;
}

.rp-sidebar-collapsed .rp-nav-group {
  margin-bottom: 4px;
}

.rp-sidebar-collapsed .rp-nav-group-body {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

.rp-sidebar-collapsed .rp-nav-child {
  display: none !important;
}

.rp-sidebar-collapsed .rp-sidebar-footer {
  margin-top: 12px;
  padding-top: 12px;
}

.rp-sidebar-collapsed .rp-logout-btn {
  height: 40px !important;
  padding: 0 !important;
  justify-content: center !important;
  border-radius: 10px !important;
}

.rp-sidebar-collapsed .rp-logout-btn span:not(.rp-logout-icon) {
  display: none !important;
}

.rp-sidebar-collapsed .rp-logout-icon {
  font-size: 16px !important;
}

/* ===== Topbar Fix ===== */
.rp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(245, 158, 11, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  flex-wrap: nowrap;
  gap: 16px;
  min-height: 62px;
}

.rp-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.rp-topbar-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.rp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .rp-topbar { flex-wrap: wrap; justify-content: center; }
  .rp-topbar-brand { flex: 0 0 100%; justify-content: center; margin-bottom: 8px; }
  .rp-topbar-center { flex: 0 0 100%; justify-content: center; margin-bottom: 8px; }
  .rp-topbar-actions { flex: 0 0 100%; justify-content: center; }
}

/* ========== Royal Palace Sidebar Clean Collapse Restore ========== */
.rp-sidebar.rp-sidebar-collapsed {
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  padding: 18px 8px !important;
  background:
    radial-gradient(circle at top, rgba(245, 158, 11, 0.10), transparent 28%),
    linear-gradient(180deg, #0a1024 0%, #060916 100%) !important;
  border-left: 1px solid rgba(245, 158, 11, 0.10) !important;
  overflow-x: hidden !important;
}

.rp-sidebar-collapsed .rp-sidebar-brand {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 0 0 14px !important;
  margin-bottom: 12px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.rp-sidebar-collapsed .rp-sidebar-brand-mark {
  width: 46px !important;
  height: 46px !important;
  margin: 0 !important;
  border-radius: 15px !important;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.26) !important;
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: fixed !important;
  right: 18px !important;
  top: 92px !important;
  left: auto !important;
  transform: none !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 9px !important;
  z-index: 20 !important;
  background: rgba(245, 158, 11, 0.14) !important;
  border: 1px solid rgba(245, 158, 11, 0.28) !important;
  color: #fbbf24 !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22) !important;
}

.rp-sidebar-collapsed .rp-collapse-btn:hover {
  transform: translateY(-1px) !important;
  background: rgba(245, 158, 11, 0.22) !important;
}

.rp-sidebar-collapsed .rp-sidebar-brand-text,
.rp-sidebar-collapsed .rp-search-wrap,
.rp-sidebar-collapsed .rp-sidebar-current,
.rp-sidebar-collapsed .rp-sidebar-profile,
.rp-sidebar-collapsed .rp-theme-toggle,
.rp-sidebar-collapsed .rp-sidebar-section-title,
.rp-sidebar-collapsed .rp-nav-text,
.rp-sidebar-collapsed .rp-chevron,
.rp-sidebar-collapsed .rp-nav-active-dot,
.rp-sidebar-collapsed .rp-nav-group-body,
.rp-sidebar-collapsed .rp-sidebar-version,
.rp-sidebar-collapsed .rp-brand-pulse {
  display: none !important;
}

.rp-sidebar-collapsed .rp-nav {
  display: grid !important;
  grid-gap: 10px !important;
  gap: 10px !important;
  justify-items: center !important;
  padding-top: 4px !important;
}

.rp-sidebar-collapsed .rp-nav-group,
.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  width: 100% !important;
  margin: 0 !important;
}

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  position: relative !important;
  width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 15px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.rp-sidebar-collapsed .rp-nav-item:hover,
.rp-sidebar-collapsed .rp-nav-group-head:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  transform: translateY(-1px) !important;
}

.rp-sidebar-collapsed .rp-group-icon,
.rp-sidebar-collapsed .rp-nav-bullet {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
  color: #fbbf24 !important;
  font-size: 16px !important;
}

.rp-sidebar-collapsed .rp-nav-group:nth-of-type(1) .rp-group-icon { color: #f59e0b !important; background: rgba(245, 158, 11, 0.10) !important; }
.rp-sidebar-collapsed .rp-nav-group:nth-of-type(2) .rp-group-icon { color: #60a5fa !important; background: rgba(59, 130, 246, 0.10) !important; }
.rp-sidebar-collapsed .rp-nav-group:nth-of-type(3) .rp-group-icon { color: #34d399 !important; background: rgba(34, 197, 94, 0.10) !important; }
.rp-sidebar-collapsed .rp-nav-group:nth-of-type(4) .rp-group-icon { color: #a78bfa !important; background: rgba(168, 85, 247, 0.10) !important; }
.rp-sidebar-collapsed .rp-nav-group:nth-of-type(5) .rp-group-icon { color: #f87171 !important; background: rgba(239, 68, 68, 0.10) !important; }
.rp-sidebar-collapsed .rp-nav-group:nth-of-type(6) .rp-group-icon { color: #22d3ee !important; background: rgba(6, 182, 212, 0.10) !important; }

.rp-sidebar-collapsed .rp-group-icon svg,
.rp-sidebar-collapsed .rp-nav-bullet svg {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.rp-sidebar-collapsed .rp-nav-bullet {
  color: #fbbf24 !important;
  background: rgba(245, 158, 11, 0.08) !important;
  border-color: rgba(245, 158, 11, 0.10) !important;
}

.rp-sidebar-collapsed .rp-nav-active {
  background: rgba(245, 158, 11, 0.10) !important;
  border-color: rgba(245, 158, 11, 0.22) !important;
}

.rp-sidebar-collapsed .rp-nav-active .rp-nav-bullet,
.rp-sidebar-collapsed .rp-nav-active .rp-group-icon {
  color: #fbbf24 !important;
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.28) !important;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.10) !important;
}

.rp-sidebar-collapsed .rp-nav-active::before {
  content: "" !important;
  position: absolute !important;
  right: -9px !important;
  top: 12px !important;
  bottom: 12px !important;
  width: 3px !important;
  border-radius: 999px !important;
  background: #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.55) !important;
}

.rp-sidebar-collapsed .rp-sidebar-footer {
  margin-top: auto !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  width: 100% !important;
}

.rp-sidebar-collapsed .rp-logout-btn {
  width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  border-radius: 15px !important;
  display: grid !important;
  place-items: center !important;
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.20) !important;
}

.rp-sidebar-collapsed .rp-logout-btn span:not(.rp-logout-icon) {
  display: none !important;
}

.rp-sidebar-collapsed .rp-logout-icon {
  font-size: 18px !important;
  color: #f87171 !important;
}

/* ===== Collapsed Sidebar - Clean & Simple ===== */
.rp-sidebar-collapsed .rp-sidebar-brand {
  justify-content: center;
  padding: 6px 4px 14px;
}

.rp-sidebar-collapsed .rp-sidebar-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  font-size: 14px;
}

/* Hide all text elements in collapsed mode */
.rp-sidebar-collapsed .rp-search-wrap,
.rp-sidebar-collapsed .rp-sidebar-current,
.rp-sidebar-collapsed .rp-sidebar-profile,
.rp-sidebar-collapsed .rp-sidebar-section-title,
.rp-sidebar-collapsed .rp-nav-hint,
.rp-sidebar-collapsed .rp-nav-label,
.rp-sidebar-collapsed .rp-nav-text,
.rp-sidebar-collapsed .rp-chevron,
.rp-sidebar-collapsed .rp-sidebar-version,
.rp-sidebar-collapsed .rp-nav-empty {
  display: none !important;
}

/* Clean collapsed nav items */
.rp-sidebar-collapsed .rp-nav {
  gap: 4px;
}

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  padding: 8px !important;
  justify-content: center !important;
  min-height: 40px !important;
  margin: 0 !important;
  border-radius: 10px !important;
}

/* Show emoji icons centered in collapsed mode */
.rp-sidebar-collapsed .rp-group-icon {
  font-size: 20px !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  background: rgba(245, 158, 11, 0.10) !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 !important;
}

.rp-sidebar-collapsed .rp-nav-group-head:hover .rp-group-icon {
  background: rgba(245, 158, 11, 0.20) !important;
  transform: scale(1.08) !important;
}

/* Item bullets become small dots in collapsed mode */
.rp-sidebar-collapsed .rp-nav-bullet {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: rgba(245, 158, 11, 0.35) !important;
  display: block !important;
  margin: 0 !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.18) !important;
}

.rp-sidebar-collapsed .rp-nav-item:hover .rp-nav-bullet {
  background: #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5) !important;
}

.rp-sidebar-collapsed .rp-nav-active .rp-nav-bullet {
  background: #f59e0b !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.7) !important;
}

/* Hide child items in collapsed mode */
.rp-sidebar-collapsed .rp-nav-group-body {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

.rp-sidebar-collapsed .rp-nav-child {
  display: none !important;
}

/* Active dot hidden in collapsed mode */
.rp-sidebar-collapsed .rp-nav-active-dot {
  display: none !important;
}

/* Footer in collapsed mode */
.rp-sidebar-collapsed .rp-sidebar-footer {
  margin-top: 12px;
  padding-top: 12px;
}

.rp-sidebar-collapsed .rp-logout-btn {
  height: 40px !important;
  padding: 0 !important;
  justify-content: center !important;
  border-radius: 10px !important;
}

.rp-sidebar-collapsed .rp-logout-btn span:not(.rp-logout-icon) {
  display: none !important;
}

.rp-sidebar-collapsed .rp-logout-icon {
  font-size: 16px !important;
}

/* Active group icon glow */
.rp-sidebar-collapsed .rp-group-open .rp-group-icon {
  background: rgba(245, 158, 11, 0.18) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.20) !important;
}

/* ========== Sidebar Gold SVG Icons Restore ========== */
.rp-theme-toggle {
  display: none !important;
}

.rp-sidebar-svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rp-group-icon,
.rp-nav-bullet {
  display: grid !important;
  place-items: center !important;
  color: #fbbf24 !important;
}

.rp-group-icon {
  width: 30px !important;
  height: 30px !important;
  border-radius: 10px !important;
  background: rgba(245, 158, 11, 0.10) !important;
  border: 1px solid rgba(245, 158, 11, 0.16) !important;
}

.rp-nav-bullet {
  width: 24px !important;
  min-width: 24px !important;
  height: 24px !important;
  border-radius: 9px !important;
  background: rgba(245, 158, 11, 0.07) !important;
  border: 1px solid rgba(245, 158, 11, 0.10) !important;
}

.rp-nav-child .rp-nav-bullet {
  width: 20px !important;
  min-width: 20px !important;
  height: 20px !important;
}

.rp-nav-child .rp-nav-bullet .rp-sidebar-svg {
  width: 14px;
  height: 14px;
}

.rp-nav-item:hover .rp-nav-bullet,
.rp-nav-group-head:hover .rp-group-icon {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.26) !important;
  color: #fbbf24 !important;
}

.rp-nav-active .rp-nav-bullet {
  background: rgba(245, 158, 11, 0.20) !important;
  border-color: rgba(245, 158, 11, 0.36) !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.18) !important;
}

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  cursor: pointer !important;
}

.rp-sidebar-collapsed .rp-group-icon,
.rp-sidebar-collapsed .rp-nav-bullet {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  border-radius: 12px !important;
}

.rp-sidebar-collapsed .rp-sidebar-svg {
  width: 19px !important;
  height: 19px !important;
}

.rp-sidebar-collapsed .rp-nav-group-head:hover::after,
.rp-sidebar-collapsed .rp-nav-item:hover::after {
  content: attr(title);
  position: fixed;
  right: 82px;
  z-index: 9999;
  max-width: 220px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(12, 18, 36, 0.98);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

/* ===== Collapsed Sidebar - Clean & Gold ===== */
.rp-sidebar-collapsed .rp-sidebar-brand {
  justify-content: center;
  padding: 6px 4px 14px;
}

.rp-sidebar-collapsed .rp-sidebar-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  font-size: 14px;
}

/* Hide text in collapsed mode */
.rp-sidebar-collapsed .rp-search-wrap,
.rp-sidebar-collapsed .rp-sidebar-current,
.rp-sidebar-collapsed .rp-sidebar-profile,
.rp-sidebar-collapsed .rp-sidebar-section-title,
.rp-sidebar-collapsed .rp-nav-hint,
.rp-sidebar-collapsed .rp-nav-label,
.rp-sidebar-collapsed .rp-nav-text,
.rp-sidebar-collapsed .rp-chevron,
.rp-sidebar-collapsed .rp-sidebar-version,
.rp-sidebar-collapsed .rp-nav-empty {
  display: none !important;
}

/* Collapsed nav layout */
.rp-sidebar-collapsed .rp-nav {
  gap: 4px;
}

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  padding: 6px !important;
  justify-content: center !important;
  min-height: 38px !important;
  margin: 0 !important;
  border-radius: 10px !important;
}

/* Group icons - gold emoji style */
.rp-sidebar-collapsed .rp-group-icon {
  font-size: 22px !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.18) !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 !important;
  transition: all 0.2s ease !important;
}

.rp-sidebar-collapsed .rp-nav-group-head:hover .rp-group-icon {
  background: rgba(245, 158, 11, 0.24) !important;
  transform: scale(1.08) !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18) !important;
}

.rp-sidebar-collapsed .rp-group-open .rp-group-icon {
  background: rgba(245, 158, 11, 0.22) !important;
  border-color: rgba(245, 158, 11, 0.34) !important;
}

/* Item bullets in collapsed mode */
.rp-sidebar-collapsed .rp-nav-bullet {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: rgba(245, 158, 11, 0.30) !important;
  display: block !important;
  margin: 0 !important;
}

.rp-sidebar-collapsed .rp-nav-item:hover .rp-nav-bullet {
  background: #f59e0b !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4) !important;
}

.rp-sidebar-collapsed .rp-nav-active .rp-nav-bullet {
  background: #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6) !important;
}

/* Child items - show in collapsed mode as dots */
.rp-sidebar-collapsed .rp-nav-group-body {
  display: grid !important;
  grid-gap: 2px !important;
  gap: 2px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

.rp-sidebar-collapsed .rp-nav-child {
  display: none !important;
}

/* Active dot hidden in collapsed */
.rp-sidebar-collapsed .rp-nav-active-dot {
  display: none !important;
}

/* Footer collapsed */
.rp-sidebar-collapsed .rp-sidebar-footer {
  margin-top: 12px;
  padding-top: 12px;
}

.rp-sidebar-collapsed .rp-logout-btn {
  height: 38px !important;
  padding: 0 !important;
  justify-content: center !important;
  border-radius: 10px !important;
}

.rp-sidebar-collapsed .rp-logout-btn span:not(.rp-logout-icon) {
  display: none !important;
}

/* ===== Collapsed Sidebar - Clean & Gold ===== */
.rp-sidebar-collapsed .rp-sidebar-brand {
  justify-content: center;
  padding: 6px 4px 14px;
}

.rp-sidebar-collapsed .rp-sidebar-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  font-size: 14px;
}

/* Hide text in collapsed mode */
.rp-sidebar-collapsed .rp-search-wrap,
.rp-sidebar-collapsed .rp-sidebar-current,
.rp-sidebar-collapsed .rp-sidebar-profile,
.rp-sidebar-collapsed .rp-sidebar-section-title,
.rp-sidebar-collapsed .rp-nav-hint,
.rp-sidebar-collapsed .rp-nav-label,
.rp-sidebar-collapsed .rp-nav-text,
.rp-sidebar-collapsed .rp-chevron,
.rp-sidebar-collapsed .rp-sidebar-version,
.rp-sidebar-collapsed .rp-nav-empty {
  display: none !important;
}

/* Collapsed nav layout */
.rp-sidebar-collapsed .rp-nav {
  gap: 4px;
}

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  padding: 6px !important;
  justify-content: center !important;
  min-height: 38px !important;
  margin: 0 !important;
  border-radius: 10px !important;
}

/* Group icons - gold emoji style */
.rp-sidebar-collapsed .rp-group-icon {
  font-size: 22px !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.18) !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 !important;
  transition: all 0.2s ease !important;
}

.rp-sidebar-collapsed .rp-nav-group-head:hover .rp-group-icon {
  background: rgba(245, 158, 11, 0.24) !important;
  transform: scale(1.08) !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18) !important;
}

.rp-sidebar-collapsed .rp-group-open .rp-group-icon {
  background: rgba(245, 158, 11, 0.22) !important;
  border-color: rgba(245, 158, 11, 0.34) !important;
}

/* Item bullets in collapsed mode */
.rp-sidebar-collapsed .rp-nav-bullet {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: rgba(245, 158, 11, 0.30) !important;
  display: block !important;
  margin: 0 !important;
}

.rp-sidebar-collapsed .rp-nav-item:hover .rp-nav-bullet {
  background: #f59e0b !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4) !important;
}

.rp-sidebar-collapsed .rp-nav-active .rp-nav-bullet {
  background: #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6) !important;
}

/* Child items - show in collapsed mode as dots */
.rp-sidebar-collapsed .rp-nav-group-body {
  display: grid !important;
  grid-gap: 2px !important;
  gap: 2px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

.rp-sidebar-collapsed .rp-nav-child {
  display: none !important;
}

/* Active dot hidden in collapsed */
.rp-sidebar-collapsed .rp-nav-active-dot {
  display: none !important;
}

/* Footer collapsed */
.rp-sidebar-collapsed .rp-sidebar-footer {
  margin-top: 12px;
  padding-top: 12px;
}

.rp-sidebar-collapsed .rp-logout-btn {
  height: 38px !important;
  padding: 0 !important;
  justify-content: center !important;
  border-radius: 10px !important;
}

.rp-sidebar-collapsed .rp-logout-btn span:not(.rp-logout-icon) {
  display: none !important;
}

.rp-dash-main {
  padding: 24px;
  background:
    radial-gradient(circle at 82% 2%, rgba(245, 158, 11, 0.08), transparent 28%),
    radial-gradient(circle at 12% 36%, rgba(59, 130, 246, 0.06), transparent 30%),
    transparent;
}

.rp-command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  grid-gap: 20px;
  gap: 20px;
  margin-bottom: 20px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(245, 158, 11, 0.16);
  background:
    radial-gradient(circle at 10% 10%, rgba(245, 158, 11, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(12, 18, 36, 0.96) 0%, rgba(7, 11, 20, 0.96) 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.rp-hero-kicker {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.18);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-command-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 3.5vw, 38px);
  line-height: 1.15;
  font-weight: 950;
  letter-spacing: -0.5px;
}

.rp-command-hero p {
  max-width: 700px;
  margin: 12px 0 0;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.8;
}

.rp-hero-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.rp-hero-metadata span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 800;
}

.rp-command-health {
  display: grid;
  place-items: center;
  align-content: center;
  grid-gap: 8px;
  gap: 8px;
  min-height: 180px;
  border-radius: 20px;
  background: rgba(7, 11, 20, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-health-ring {
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #0a1024 52%, transparent 53%),
    conic-gradient(#f59e0b 0 70%, rgba(148, 163, 184, 0.12) 70% 100%);
  box-shadow: 0 0 36px rgba(245, 158, 11, 0.08);
}

.rp-health-ring span {
  color: #fbbf24;
  font-size: 18px;
  font-weight: 950;
}

.rp-command-health strong {
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.rp-command-health small {
  max-width: 190px;
  color: #94a3b8;
  text-align: center;
  line-height: 1.6;
  font-weight: 700;
  font-size: 11px;
}

.rp-dash-kpi-grid {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  margin-bottom: 20px;
}

.rp-dash-kpi-grid.primary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.rp-dash-kpi-grid.secondary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.rp-dash-kpi {
  position: relative;
  min-height: 128px;
  padding: 16px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.20);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.rp-dash-kpi:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.28);
}

.rp-dash-kpi-glow {
  position: absolute;
  top: -24px;
  left: -26px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.10;
  background: currentColor;
}

.rp-dash-kpi-label {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

.rp-dash-kpi-value {
  margin-top: 12px;
  color: #f8fafc;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 950;
  letter-spacing: -0.5px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}

.rp-currency {
  font-size: 14px;
  font-weight: 800;
  color: #94a3b8;
}

.rp-suffix {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.rp-dash-kpi-note {
  margin-top: 6px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.rp-tone-gold { color: #f59e0b; }
.rp-tone-blue { color: #60a5fa; }
.rp-tone-green { color: #34d399; }
.rp-tone-red { color: #f87171; }
.rp-tone-purple { color: #a78bfa; }
.rp-tone-cyan { color: #22d3ee; }

.rp-dash-grid {
  display: grid;
  grid-gap: 20px;
  gap: 20px;
  margin-bottom: 20px;
}

.rp-dash-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rp-dash-grid.three {
  grid-template-columns: 0.9fr 1.1fr 0.95fr;
}

.rp-dash-grid.system {
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
}

.rp-panel {
  min-width: 0;
  padding: 18px;
  border-radius: 20px;
  background: rgba(12, 18, 36, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.20);
}

.rp-panel.compact {
  min-height: 340px;
}

.rp-panel.wide {
  min-height: 300px;
}

.rp-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.rp-panel-head span {
  display: block;
  color: #fbbf24;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-panel-head h2 {
  margin: 4px 0 0;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 950;
}

.rp-panel-head b {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
}

.rp-chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 3px;
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
  margin-top: 8px;
}

.rp-ring-wrap {
  display: grid;
  place-items: center;
  min-height: 170px;
}

.rp-legend {
  display: grid;
  grid-gap: 6px;
  gap: 6px;
  margin-top: 6px;
}

.rp-legend div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  grid-gap: 7px;
  gap: 7px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
}

.rp-legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.rp-legend b {
  color: #f8fafc;
}

.rp-list {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
}

.rp-list-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  grid-gap: 8px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.rp-list-row > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #0a1024;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  font-size: 11px;
  font-weight: 950;
}

.rp-list-row strong {
  display: block;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-list-row small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
}

.rp-list-row b {
  color: #34d399;
  font-size: 10px;
  font-weight: 900;
}

.rp-profit-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.10);
}

.rp-profit-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

.rp-profit-card strong {
  color: #34d399;
  font-size: 16px;
}

.rp-progress {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
}

.rp-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #f59e0b);
}

.rp-mini-stack {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  margin-top: 10px;
}

.rp-mini-stack div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.rp-mini-stack span {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
}

.rp-mini-stack b {
  color: #f8fafc;
  font-size: 11px;
  font-weight: 950;
}

.rp-factory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  grid-gap: 12px;
  gap: 12px;
}

.rp-factory-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(7, 11, 20, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.10);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.rp-factory-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.24);
}

.rp-factory-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.rp-factory-code {
  color: #fbbf24;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.rp-factory-card h3 {
  margin: 5px 0 0;
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 950;
}

.rp-status {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 950;
}

.rp-status.good {
  color: #34d399;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.16);
}

.rp-status.warn {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.16);
}

.rp-factory-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 8px;
  gap: 8px;
  margin-top: 14px;
}

.rp-factory-metrics div {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.rp-factory-metrics span {
  display: block;
  color: #64748b;
  font-size: 9px;
  font-weight: 900;
}

.rp-factory-metrics strong {
  display: block;
  margin-top: 5px;
  color: #f8fafc;
  font-size: 18px;
  font-weight: 950;
}

.rp-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 8px;
  gap: 8px;
}

.rp-quick-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 0 10px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.10);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.rp-quick-link:hover {
  transform: translateY(-2px);
  border-color: currentColor;
}

.rp-quick-link span {
  color: #f8fafc;
  font-size: 11px;
  font-weight: 900;
}

.rp-quick-link b {
  color: currentColor;
  font-size: 9px;
  font-weight: 950;
}

.rp-empty {
  min-height: 130px;
  display: grid;
  place-items: center;
  color: #64748b;
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.42);
  border: 1px dashed rgba(148, 163, 184, 0.16);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1400px) {
  .rp-dash-kpi-grid.primary,
  .rp-dash-kpi-grid.secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .rp-command-hero,
  .rp-dash-grid.two,
  .rp-dash-grid.three,
  .rp-dash-grid.system {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .rp-dash-main {
    padding: 16px;
  }
  .rp-command-hero {
    padding: 18px;
  }
  .rp-dash-kpi-grid.primary,
  .rp-dash-kpi-grid.secondary,
  .rp-quick-grid {
    grid-template-columns: 1fr;
  }
}

.rp-dash-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  direction: rtl;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%);
  color: #f8fafc;
}

.rp-dash-main {
  flex: 1 1;
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(245, 158, 11, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  flex-wrap: wrap;
  gap: 12px;
}

.rp-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rp-topbar-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.24);
}

.rp-topbar-title {
  font-size: 14px;
  font-weight: 900;
  color: #f8fafc;
  line-height: 1.2;
}

.rp-topbar-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-topbar-center {
  display: flex;
  gap: 6px;
}

.rp-period-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rp-period-btn:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}

.rp-period-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(245, 158, 11, 0.08));
  border-color: rgba(245, 158, 11, 0.42);
  color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.10);
}

.rp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rp-icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rp-icon-btn:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.22);
  transform: translateY(-1px);
}

.rp-icon-btn.spinning {
  animation: rpSpin 0.8s linear infinite;
}

.rp-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.16);
}

.rp-clock-icon {
  font-size: 14px;
}

.rp-clock-text {
  color: #fbbf24;
  font-size: 11px;
  font-weight: 800;
}

.rp-hero {
  padding: 24px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 10% 10%, rgba(245, 158, 11, 0.16), transparent 26%),
    linear-gradient(135deg, rgba(12, 18, 36, 0.98), rgba(7, 11, 20, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.18);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

.rp-hero-eyebrow {
  color: #fbbf24;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.rp-hero-title {
  margin: 0;
  color: #fff;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 950;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.rp-hero-subtitle {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

.rp-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.rp-hero-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
}

.rp-hero-pill.success {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.22);
}

.rp-hero-pill.warning {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.22);
}

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

.rp-kpi-card {
  position: relative;
  min-height: 130px;
  padding: 18px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease;
  text-decoration: none;
  cursor: pointer;
}

.rp-kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--rp-kpi-color, rgba(245, 158, 11, 0.32));
}

.rp-kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.rp-kpi-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--rp-kpi-bg, rgba(245, 158, 11, 0.12));
  font-size: 18px;
}

.rp-kpi-trend {
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
}

.rp-kpi-trend.up { color: #4ade80; background: rgba(34, 197, 94, 0.12); }
.rp-kpi-trend.down { color: #f87171; background: rgba(239, 68, 68, 0.12); }
.rp-kpi-trend.flat { color: #94a3b8; background: rgba(148, 163, 184, 0.08); }

.rp-kpi-label {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  margin-top: 14px;
}

.rp-kpi-value {
  color: #f8fafc;
  font-size: 24px;
  font-weight: 950;
  margin-top: 6px;
  letter-spacing: -0.5px;
}

.rp-kpi-note {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}

.rp-kpi-spark {
  position: absolute;
  bottom: 10px;
  left: 14px;
  right: 14px;
  height: 40px;
  opacity: 0.55;
}

.rp-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 4px;
}

.rp-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rp-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
}

.rp-tab.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
  color: #fbbf24;
}

.rp-tab-badge {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 0 5px;
}

.rp-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-gap: 18px; gap: 18px; }
.rp-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 18px; gap: 18px; }
.rp-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-gap: 14px; gap: 14px; }

.rp-panel {
  padding: 18px;
  border-radius: 20px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.rp-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.rp-panel-title {
  margin: 0;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 900;
}

.rp-panel-sub {
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.rp-panel-tag {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.20);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 900;
}

.rp-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #64748b;
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.45);
  border: 1px dashed rgba(148, 163, 184, 0.18);
  font-size: 13px;
  font-weight: 700;
  grid-gap: 8px;
  gap: 8px;
}

.rp-empty-icon { font-size: 36px; }

.rp-product-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  grid-gap: 10px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.08);
  margin-bottom: 8px;
}

.rp-product-rank {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-weight: 950;
  font-size: 12px;
}

.rp-product-name {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-product-meta {
  text-align: left;
}

.rp-product-revenue { color: #4ade80; font-size: 12px; font-weight: 900; }
.rp-product-qty { color: #64748b; font-size: 10px; font-weight: 700; margin-top: 2px; }

.rp-insight {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 8px;
  border: 1px solid transparent;
}

.rp-insight.success { background: rgba(34, 197, 94, 0.06); border-color: rgba(34, 197, 94, 0.18); }
.rp-insight.warning { background: rgba(245, 158, 11, 0.06); border-color: rgba(245, 158, 11, 0.18); }
.rp-insight.danger { background: rgba(239, 68, 68, 0.06); border-color: rgba(239, 68, 68, 0.18); }
.rp-insight.info { background: rgba(59, 130, 246, 0.06); border-color: rgba(59, 130, 246, 0.18); }

.rp-insight-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.rp-insight-title { color: #f8fafc; font-size: 13px; font-weight: 900; }
.rp-insight-desc { margin: 4px 0 0; color: #94a3b8; font-size: 11px; font-weight: 600; line-height: 1.7; }

.rp-feed-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.rp-feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18);
  margin-top: 6px;
  flex-shrink: 0;
}

.rp-feed-title { color: #f8fafc; font-size: 12px; font-weight: 800; }
.rp-feed-meta { color: #64748b; font-size: 10px; font-weight: 600; margin-top: 3px; }

.rp-factory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  grid-gap: 14px;
  gap: 14px;
}

.rp-factory-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.10);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.rp-factory-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.24);
}

.rp-factory-head { display: flex; justify-content: space-between; align-items: center; }
.rp-factory-icon { font-size: 22px; }
.rp-factory-status { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.rp-factory-status.active { color: #4ade80; background: rgba(34, 197, 94, 0.10); }
.rp-factory-status.inactive { color: #f87171; background: rgba(239, 68, 68, 0.10); }
.rp-factory-name { color: #f8fafc; font-size: 13px; font-weight: 900; margin: 10px 0 0; }
.rp-factory-stats { display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 10px; gap: 10px; margin-top: 14px; }
.rp-factory-stat-label { color: #64748b; font-size: 10px; font-weight: 700; }
.rp-factory-stat-value { color: #f8fafc; font-size: 18px; font-weight: 950; }

.rp-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.rp-quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.10);
  text-decoration: none;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.rp-quick-link:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.28);
}

.rp-quick-icon { font-size: 20px; }

.rp-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.08);
  flex-wrap: wrap;
  gap: 10px;
}

.rp-status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.rp-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.rp-fade-in { animation: rpFadeIn 0.35s ease-out; }

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

@keyframes rpSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1200px) {
  .rp-grid-2, .rp-grid-3, .rp-grid-4 { grid-template-columns: 1fr; }
  .rp-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .rp-dash-main { padding: 16px; }
  .rp-kpi-grid { grid-template-columns: 1fr; }
  .rp-topbar { flex-direction: column; align-items: stretch; }
  .rp-topbar-center { justify-content: center; flex-wrap: wrap; }
  .rp-topbar-actions { justify-content: center; }
  .rp-quick-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== Royal Palace Sidebar Pro v2 ========== */
.rp-sidebar {
  width: 290px;
  min-width: 290px;
  max-width: 290px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0a1024 0%, #060916 100%);
  color: #f1f5f9;
  padding: 18px 14px;
  flex-shrink: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  align-self: flex-start;
  border-left: 1px solid rgba(245, 158, 11, 0.10);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.3) transparent;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-sidebar::-webkit-scrollbar { width: 6px; }
.rp-sidebar::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 999px;
}
.rp-sidebar::-webkit-scrollbar-track { background: transparent; }

.rp-sidebar-collapsed {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  padding: 18px 8px;
}

.rp-sidebar-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-sidebar-brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.32),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.rp-brand-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  border: 2px solid rgba(245, 158, 11, 0.5);
  opacity: 0;
  animation: rpBrandPulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes rpBrandPulse {
  0% { opacity: 0.7; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.18); }
}

.rp-sidebar-brand-text {
  flex: 1 1;
  min-width: 0;
}

.rp-sidebar-brand-text h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.rp-sidebar-brand-text p {
  margin: 3px 0 0;
  font-size: 10px;
  color: rgba(245, 158, 11, 0.85);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-collapse-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  transform: translateX(-2px);
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.rp-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.rp-search-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  pointer-events: none;
}

.rp-search-input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  padding: 0 30px 0 30px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.rp-search-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.rp-search-wrap.focused .rp-search-input {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.06);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.rp-search-clear {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.rp-search-clear:hover { background: rgba(239, 68, 68, 0.3); }

.rp-sidebar-current {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.rp-sidebar-current-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.rp-sidebar-current-value {
  font-size: 13px;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: -0.2px;
}

.rp-sidebar-profile {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-profile-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.32);
}

.rp-profile-status {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0a1024;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.rp-profile-info {
  flex: 1 1;
  min-width: 0;
}

.rp-profile-name {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-profile-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  margin-top: 2px;
}

.rp-profile-key { color: rgba(255, 255, 255, 0.55); font-weight: 700; }
.rp-profile-row strong { color: #fbbf24; font-weight: 800; font-size: 10px; }

.rp-theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  margin-bottom: 12px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  justify-content: center;
}

.rp-theme-toggle:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
  transform: translateY(-1px);
}

.rp-theme-icon {
  font-size: 16px;
  line-height: 1;
}

.rp-sidebar-collapsed .rp-theme-toggle {
  padding: 0;
  height: 42px;
}

.rp-sidebar-section-title {
  margin: 14px 0 8px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rp-nav {
  display: grid;
  grid-gap: 3px;
  gap: 3px;
}

.rp-nav-group {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  margin-bottom: 4px;
}

.rp-nav-group-body {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  padding: 4px 0 6px 0;
  margin-right: 4px;
  border-right: 2px solid rgba(245, 158, 11, 0.14);
  animation: rpFadeSlide 0.22s ease-out;
}

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

.rp-nav-item,
.rp-nav-group-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-nav-item:hover,
.rp-nav-group-head:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  transform: translateX(-2px);
}

.rp-nav-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(245, 158, 11, 0.06));
  border-color: rgba(245, 158, 11, 0.34);
  color: #fbbf24 !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rp-nav-active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: -14px;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.rp-sidebar-collapsed .rp-nav-active::before {
  right: -8px;
}

.rp-nav-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-item:hover .rp-nav-bullet { background: rgba(245, 158, 11, 0.6); }
.rp-nav-active .rp-nav-bullet {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.rp-nav-child .rp-nav-bullet { width: 4px; height: 4px; }

.rp-group-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-group-head:hover .rp-group-icon {
  background: rgba(245, 158, 11, 0.16);
  transform: scale(1.05);
}

.rp-group-open .rp-group-icon {
  background: rgba(245, 158, 11, 0.14);
}

.rp-nav-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1;
  min-width: 0;
}

.rp-nav-label {
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-active .rp-nav-hint { color: rgba(251, 191, 36, 0.7); }

.rp-nav-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
  flex-shrink: 0;
  animation: rpDotPulse 1.6s ease-in-out infinite;
}

@keyframes rpDotPulse {
  50% { opacity: 0.5; transform: scale(0.85); }
}

.rp-chevron {
  font-weight: 900;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.rp-chevron.open { transform: rotate(90deg); color: #fbbf24; }

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  padding: 10px;
  justify-content: center;
}

.rp-sidebar-collapsed .rp-nav-bullet { display: none; }
.rp-sidebar-collapsed .rp-group-icon {
  width: 32px; height: 32px; font-size: 16px;
}

.rp-nav-empty {
  text-align: center;
  padding: 30px 14px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 700;
}

.rp-sidebar-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-logout-btn {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.rp-logout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.42);
  transform: translateY(-1px);
}

.rp-logout-icon { font-size: 16px; }

.rp-sidebar-version {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
}

.rp-status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: rpDotPulse 2s ease-in-out infinite;
}

.rp-mobile-menu-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1400;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.32);
}

.rp-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 1498;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: rpFadeIn 0.22s ease-out;
}

.rp-sidebar-mobile {
  position: fixed;
  top: 0;
  right: 0;
  width: 88vw;
  max-width: 340px;
  height: 100vh;
  z-index: 1499;
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.55);
  animation: rpSlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rpSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.rp-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rp-mobile-title {
  font-size: 16px;
  font-weight: 900;
  color: #fbbf24;
}

.rp-mobile-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 991px) {
  .rp-sidebar { display: none; }
  .erp-shell { display: block; }
  .erp-main, .rp-dash-main { padding-top: 80px; }
}

[data-theme="dark"] {
  --rp-bg: #0a1024;
  --rp-surface: #0c1224;
  --rp-text: #f8fafc;
  --rp-border: rgba(245, 158, 11, 0.12);
}

/* ========== Royal Palace Sidebar Pro v2 ========== */
.rp-sidebar {
  width: 290px;
  min-width: 290px;
  max-width: 290px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0a1024 0%, #060916 100%);
  color: #f1f5f9;
  padding: 18px 14px;
  flex-shrink: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  align-self: flex-start;
  border-left: 1px solid rgba(245, 158, 11, 0.10);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.3) transparent;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-sidebar::-webkit-scrollbar { width: 6px; }
.rp-sidebar::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 999px;
}
.rp-sidebar::-webkit-scrollbar-track { background: transparent; }

.rp-sidebar-collapsed {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  padding: 18px 8px;
}

.rp-sidebar-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-sidebar-brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.32),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.rp-brand-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  border: 2px solid rgba(245, 158, 11, 0.5);
  opacity: 0;
  animation: rpBrandPulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes rpBrandPulse {
  0% { opacity: 0.7; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.18); }
}

.rp-sidebar-brand-text {
  flex: 1 1;
  min-width: 0;
}

.rp-sidebar-brand-text h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.rp-sidebar-brand-text p {
  margin: 3px 0 0;
  font-size: 10px;
  color: rgba(245, 158, 11, 0.85);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-collapse-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  transform: translateX(-2px);
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.rp-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.rp-search-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  pointer-events: none;
}

.rp-search-input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  padding: 0 30px 0 30px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.rp-search-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.rp-search-wrap.focused .rp-search-input {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.06);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.rp-search-clear {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.rp-search-clear:hover { background: rgba(239, 68, 68, 0.3); }

.rp-sidebar-current {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.rp-sidebar-current-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.rp-sidebar-current-value {
  font-size: 13px;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: -0.2px;
}

.rp-sidebar-profile {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-profile-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.32);
}

.rp-profile-status {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0a1024;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.rp-profile-info {
  flex: 1 1;
  min-width: 0;
}

.rp-profile-name {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-profile-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  margin-top: 2px;
}

.rp-profile-key { color: rgba(255, 255, 255, 0.55); font-weight: 700; }
.rp-profile-row strong { color: #fbbf24; font-weight: 800; font-size: 10px; }

.rp-theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  margin-bottom: 12px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  justify-content: center;
}

.rp-theme-toggle:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
  transform: translateY(-1px);
}

.rp-theme-icon {
  font-size: 16px;
  line-height: 1;
}

.rp-sidebar-collapsed .rp-theme-toggle {
  padding: 0;
  height: 42px;
}

.rp-sidebar-section-title {
  margin: 14px 0 8px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rp-nav {
  display: grid;
  grid-gap: 3px;
  gap: 3px;
}

.rp-nav-group {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  margin-bottom: 4px;
}

.rp-nav-group-body {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  padding: 4px 0 6px 0;
  margin-right: 4px;
  border-right: 2px solid rgba(245, 158, 11, 0.14);
  animation: rpFadeSlide 0.22s ease-out;
}

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

.rp-nav-item,
.rp-nav-group-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-nav-item:hover,
.rp-nav-group-head:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  transform: translateX(-2px);
}

.rp-nav-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(245, 158, 11, 0.06));
  border-color: rgba(245, 158, 11, 0.34);
  color: #fbbf24 !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rp-nav-active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: -14px;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.rp-sidebar-collapsed .rp-nav-active::before {
  right: -8px;
}

.rp-nav-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-item:hover .rp-nav-bullet { background: rgba(245, 158, 11, 0.6); }
.rp-nav-active .rp-nav-bullet {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.rp-nav-child .rp-nav-bullet { width: 4px; height: 4px; }

.rp-group-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-group-head:hover .rp-group-icon {
  background: rgba(245, 158, 11, 0.16);
  transform: scale(1.05);
}

.rp-group-open .rp-group-icon {
  background: rgba(245, 158, 11, 0.14);
}

.rp-nav-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1;
  min-width: 0;
}

.rp-nav-label {
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-active .rp-nav-hint { color: rgba(251, 191, 36, 0.7); }

.rp-nav-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
  flex-shrink: 0;
  animation: rpDotPulse 1.6s ease-in-out infinite;
}

@keyframes rpDotPulse {
  50% { opacity: 0.5; transform: scale(0.85); }
}

.rp-chevron {
  font-weight: 900;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.rp-chevron.open { transform: rotate(90deg); color: #fbbf24; }

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  padding: 10px;
  justify-content: center;
}

.rp-sidebar-collapsed .rp-nav-bullet { display: none; }
.rp-sidebar-collapsed .rp-group-icon {
  width: 32px; height: 32px; font-size: 16px;
}

.rp-nav-empty {
  text-align: center;
  padding: 30px 14px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 700;
}

.rp-sidebar-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-logout-btn {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.rp-logout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.42);
  transform: translateY(-1px);
}

.rp-logout-icon { font-size: 16px; }

.rp-sidebar-version {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
}

.rp-status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: rpDotPulse 2s ease-in-out infinite;
}

.rp-mobile-menu-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1400;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.32);
}

.rp-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 1498;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: rpFadeIn 0.22s ease-out;
}

.rp-sidebar-mobile {
  position: fixed;
  top: 0;
  right: 0;
  width: 88vw;
  max-width: 340px;
  height: 100vh;
  z-index: 1499;
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.55);
  animation: rpSlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rpSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.rp-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rp-mobile-title {
  font-size: 16px;
  font-weight: 900;
  color: #fbbf24;
}

.rp-mobile-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 991px) {
  .rp-sidebar { display: none; }
  .erp-shell { display: block; }
  .erp-main, .rp-dash-main { padding-top: 80px; }
}

[data-theme="dark"] {
  --rp-bg: #0a1024;
  --rp-surface: #0c1224;
  --rp-text: #f8fafc;
  --rp-border: rgba(245, 158, 11, 0.12);
}

/* ========== Royal Palace Sidebar Pro v2 ========== */
.rp-sidebar {
  width: 290px;
  min-width: 290px;
  max-width: 290px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0a1024 0%, #060916 100%);
  color: #f1f5f9;
  padding: 18px 14px;
  flex-shrink: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  align-self: flex-start;
  border-left: 1px solid rgba(245, 158, 11, 0.10);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.3) transparent;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-sidebar::-webkit-scrollbar { width: 6px; }
.rp-sidebar::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 999px;
}
.rp-sidebar::-webkit-scrollbar-track { background: transparent; }

.rp-sidebar-collapsed {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  padding: 18px 8px;
}

.rp-sidebar-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-sidebar-brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.32),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.rp-brand-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  border: 2px solid rgba(245, 158, 11, 0.5);
  opacity: 0;
  animation: rpBrandPulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes rpBrandPulse {
  0% { opacity: 0.7; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.18); }
}

.rp-sidebar-brand-text {
  flex: 1 1;
  min-width: 0;
}

.rp-sidebar-brand-text h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.rp-sidebar-brand-text p {
  margin: 3px 0 0;
  font-size: 10px;
  color: rgba(245, 158, 11, 0.85);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-collapse-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  transform: translateX(-2px);
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.rp-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.rp-search-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  pointer-events: none;
}

.rp-search-input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  padding: 0 30px 0 30px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.rp-search-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.rp-search-wrap.focused .rp-search-input {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.06);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.rp-search-clear {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.rp-search-clear:hover { background: rgba(239, 68, 68, 0.3); }

.rp-sidebar-current {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.rp-sidebar-current-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.rp-sidebar-current-value {
  font-size: 13px;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: -0.2px;
}

.rp-sidebar-profile {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-profile-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.32);
}

.rp-profile-status {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0a1024;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.rp-profile-info {
  flex: 1 1;
  min-width: 0;
}

.rp-profile-name {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-profile-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  margin-top: 2px;
}

.rp-profile-key { color: rgba(255, 255, 255, 0.55); font-weight: 700; }
.rp-profile-row strong { color: #fbbf24; font-weight: 800; font-size: 10px; }

.rp-theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  margin-bottom: 12px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  justify-content: center;
}

.rp-theme-toggle:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
  transform: translateY(-1px);
}

.rp-theme-icon {
  font-size: 16px;
  line-height: 1;
}

.rp-sidebar-collapsed .rp-theme-toggle {
  padding: 0;
  height: 42px;
}

.rp-sidebar-section-title {
  margin: 14px 0 8px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rp-nav {
  display: grid;
  grid-gap: 3px;
  gap: 3px;
}

.rp-nav-group {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  margin-bottom: 4px;
}

.rp-nav-group-body {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  padding: 4px 0 6px 0;
  margin-right: 4px;
  border-right: 2px solid rgba(245, 158, 11, 0.14);
  animation: rpFadeSlide 0.22s ease-out;
}

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

.rp-nav-item,
.rp-nav-group-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-nav-item:hover,
.rp-nav-group-head:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  transform: translateX(-2px);
}

.rp-nav-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(245, 158, 11, 0.06));
  border-color: rgba(245, 158, 11, 0.34);
  color: #fbbf24 !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rp-nav-active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: -14px;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.rp-sidebar-collapsed .rp-nav-active::before {
  right: -8px;
}

.rp-nav-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-item:hover .rp-nav-bullet { background: rgba(245, 158, 11, 0.6); }
.rp-nav-active .rp-nav-bullet {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.rp-nav-child .rp-nav-bullet { width: 4px; height: 4px; }

.rp-group-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-group-head:hover .rp-group-icon {
  background: rgba(245, 158, 11, 0.16);
  transform: scale(1.05);
}

.rp-group-open .rp-group-icon {
  background: rgba(245, 158, 11, 0.14);
}

.rp-nav-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1;
  min-width: 0;
}

.rp-nav-label {
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-active .rp-nav-hint { color: rgba(251, 191, 36, 0.7); }

.rp-nav-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
  flex-shrink: 0;
  animation: rpDotPulse 1.6s ease-in-out infinite;
}

@keyframes rpDotPulse {
  50% { opacity: 0.5; transform: scale(0.85); }
}

.rp-chevron {
  font-weight: 900;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.rp-chevron.open { transform: rotate(90deg); color: #fbbf24; }

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  padding: 10px;
  justify-content: center;
}

.rp-sidebar-collapsed .rp-nav-bullet { display: none; }
.rp-sidebar-collapsed .rp-group-icon {
  width: 32px; height: 32px; font-size: 16px;
}

.rp-nav-empty {
  text-align: center;
  padding: 30px 14px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 700;
}

.rp-sidebar-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-logout-btn {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.rp-logout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.42);
  transform: translateY(-1px);
}

.rp-logout-icon { font-size: 16px; }

.rp-sidebar-version {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
}

.rp-status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: rpDotPulse 2s ease-in-out infinite;
}

.rp-mobile-menu-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1400;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.32);
}

.rp-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 1498;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: rpFadeIn 0.22s ease-out;
}

.rp-sidebar-mobile {
  position: fixed;
  top: 0;
  right: 0;
  width: 88vw;
  max-width: 340px;
  height: 100vh;
  z-index: 1499;
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.55);
  animation: rpSlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rpSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.rp-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rp-mobile-title {
  font-size: 16px;
  font-weight: 900;
  color: #fbbf24;
}

.rp-mobile-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 991px) {
  .rp-sidebar { display: none; }
  .erp-shell { display: block; }
  .erp-main, .rp-dash-main { padding-top: 80px; }
}

[data-theme="dark"] {
  --rp-bg: #0a1024;
  --rp-surface: #0c1224;
  --rp-text: #f8fafc;
  --rp-border: rgba(245, 158, 11, 0.12);
}

[data-theme="light"] {
  --rp-bg: #f3f5f9;
  --rp-bg-soft: #eef2f7;
  --rp-surface: #ffffff;
  --rp-surface-2: #f8fafc;
  --rp-border: #dde5ef;
  --rp-border-strong: #cfd9e6;
  --rp-text: #0f172a;
  --rp-text-soft: #475569;
  --rp-text-muted: #64748b;
  --rp-navy-1: #08172f;
  --rp-navy-2: #0b1f4d;
  --rp-navy-3: #103a7a;
  --rp-gold: #c9a66b;
  --rp-gold-strong: #d6b47a;
  --rp-success: #15803d;
  --rp-success-bg: #e8f7ee;
  --rp-warning: #b45309;
  --rp-warning-bg: #fff4df;
  --rp-danger: #b91c1c;
  --rp-danger-bg: #fee2e2;
  --rp-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --rp-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] body,
[data-theme="light"] .erp-shell {
  background:
    radial-gradient(circle at top right, rgba(201, 166, 107, 0.08), transparent 20%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: var(--rp-text);
}

[data-theme="light"] .erp-main {
  color: var(--rp-text);
}

[data-theme="light"] .erp-section-card,
[data-theme="light"] .erp-card,
[data-theme="light"] .erp-form-shell,
[data-theme="light"] .erp-metric-tile,
[data-theme="light"] .erp-workspace-topbar {
  background: var(--rp-surface);
  border-color: var(--rp-border);
  color: var(--rp-text);
}

[data-theme="light"] .erp-table th {
  background: var(--rp-surface-2);
  color: var(--rp-text-soft);
}

[data-theme="light"] .erp-table td {
  color: var(--rp-text);
}

[data-theme="light"] .erp-input,
[data-theme="light"] .erp-search {
  background: #ffffff;
  color: var(--rp-text);
  border-color: var(--rp-border);
}

[data-theme="dark"] {
  --rp-bg: #070b14;
  --rp-bg-soft: #0c1224;
  --rp-surface: #0c1224;
  --rp-surface-2: #070b14;
  --rp-border: #1e293b;
  --rp-border-strong: #334155;
  --rp-text: #f8fafc;
  --rp-text-soft: #cbd5e1;
  --rp-text-muted: #64748b;
  --rp-navy-1: #070b14;
  --rp-navy-2: #0c1224;
  --rp-navy-3: #1e293b;
  --rp-gold: #fbbf24;
  --rp-gold-strong: #f59e0b;
  --rp-success: #34d399;
  --rp-success-bg: rgba(52, 211, 153, 0.1);
  --rp-warning: #fbbf24;
  --rp-warning-bg: rgba(251, 191, 36, 0.1);
  --rp-danger: #f87171;
  --rp-danger-bg: rgba(248, 113, 113, 0.1);
  --rp-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  --rp-shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body,
[data-theme="dark"] .erp-shell {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%);
  color: var(--rp-text);
}

[data-theme="dark"] .erp-main {
  color: var(--rp-text);
}

[data-theme="dark"] .erp-section-card,
[data-theme="dark"] .erp-card,
[data-theme="dark"] .erp-form-shell,
[data-theme="dark"] .erp-metric-tile,
[data-theme="dark"] .erp-workspace-topbar {
  background: var(--rp-surface);
  border-color: var(--rp-border);
  color: var(--rp-text);
}

[data-theme="dark"] .erp-input,
[data-theme="dark"] .erp-search {
  background: #070b14;
  color: var(--rp-text);
  border-color: var(--rp-border);
}

[data-theme="light"] {
  --rp-bg: #f3f5f9;
  --rp-bg-soft: #eef2f7;
  --rp-surface: #ffffff;
  --rp-surface-2: #f8fafc;
  --rp-border: #dde5ef;
  --rp-border-strong: #cfd9e6;
  --rp-text: #0f172a;
  --rp-text-soft: #475569;
  --rp-text-muted: #64748b;
  --rp-navy-1: #08172f;
  --rp-navy-2: #0b1f4d;
  --rp-navy-3: #103a7a;
  --rp-gold: #c9a66b;
  --rp-gold-strong: #d6b47a;
  --rp-success: #15803d;
  --rp-success-bg: #e8f7ee;
  --rp-warning: #b45309;
  --rp-warning-bg: #fff4df;
  --rp-danger: #b91c1c;
  --rp-danger-bg: #fee2e2;
  --rp-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --rp-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] body,
[data-theme="light"] .erp-shell {
  background:
    radial-gradient(circle at top right, rgba(201, 166, 107, 0.08), transparent 20%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: var(--rp-text);
}

[data-theme="light"] .erp-main {
  color: var(--rp-text);
}

[data-theme="light"] .erp-section-card,
[data-theme="light"] .erp-card,
[data-theme="light"] .erp-form-shell,
[data-theme="light"] .erp-metric-tile,
[data-theme="light"] .erp-workspace-topbar {
  background: var(--rp-surface);
  border-color: var(--rp-border);
  color: var(--rp-text);
}

[data-theme="light"] .erp-table th {
  background: var(--rp-surface-2);
  color: var(--rp-text-soft);
}

[data-theme="light"] .erp-table td {
  color: var(--rp-text);
}

[data-theme="light"] .erp-input,
[data-theme="light"] .erp-search {
  background: #ffffff;
  color: var(--rp-text);
  border-color: var(--rp-border);
}

[data-theme="dark"] {
  --rp-bg: #070b14;
  --rp-bg-soft: #0c1224;
  --rp-surface: #0c1224;
  --rp-surface-2: #070b14;
  --rp-border: #1e293b;
  --rp-border-strong: #334155;
  --rp-text: #f8fafc;
  --rp-text-soft: #cbd5e1;
  --rp-text-muted: #64748b;
  --rp-navy-1: #070b14;
  --rp-navy-2: #0c1224;
  --rp-navy-3: #1e293b;
  --rp-gold: #fbbf24;
  --rp-gold-strong: #f59e0b;
  --rp-success: #34d399;
  --rp-success-bg: rgba(52, 211, 153, 0.1);
  --rp-warning: #fbbf24;
  --rp-warning-bg: rgba(251, 191, 36, 0.1);
  --rp-danger: #f87171;
  --rp-danger-bg: rgba(248, 113, 113, 0.1);
  --rp-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  --rp-shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body,
[data-theme="dark"] .erp-shell {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%);
  color: var(--rp-text);
}

[data-theme="dark"] .erp-main {
  color: var(--rp-text);
}

[data-theme="dark"] .erp-section-card,
[data-theme="dark"] .erp-card,
[data-theme="dark"] .erp-form-shell,
[data-theme="dark"] .erp-metric-tile,
[data-theme="dark"] .erp-workspace-topbar {
  background: var(--rp-surface);
  border-color: var(--rp-border);
  color: var(--rp-text);
}

[data-theme="dark"] .erp-input,
[data-theme="dark"] .erp-search {
  background: #070b14;
  color: var(--rp-text);
  border-color: var(--rp-border);
}

[data-theme="light"] {
  --rp-bg: #f3f5f9;
  --rp-bg-soft: #eef2f7;
  --rp-surface: #ffffff;
  --rp-surface-2: #f8fafc;
  --rp-border: #dde5ef;
  --rp-border-strong: #cfd9e6;
  --rp-text: #0f172a;
  --rp-text-soft: #475569;
  --rp-text-muted: #64748b;
  --rp-gold: #c9a66b;
  --rp-gold-strong: #d6b47a;
  --rp-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --rp-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] {
  --rp-bg: #070b14;
  --rp-bg-soft: #0c1224;
  --rp-surface: #0c1224;
  --rp-surface-2: #070b14;
  --rp-border: #1e293b;
  --rp-border-strong: #334155;
  --rp-text: #f8fafc;
  --rp-text-soft: #cbd5e1;
  --rp-text-muted: #64748b;
  --rp-gold: #fbbf24;
  --rp-gold-strong: #f59e0b;
  --rp-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  --rp-shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] body,
[data-theme="light"] .erp-shell {
  background:
    radial-gradient(circle at top right, rgba(201, 166, 107, 0.08), transparent 20%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: var(--rp-text);
}

[data-theme="dark"] body,
[data-theme="dark"] .erp-shell {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%);
  color: var(--rp-text);
}

[data-theme="light"] .erp-main {
  color: var(--rp-text);
}

[data-theme="dark"] .erp-main {
  color: var(--rp-text);
}

[data-theme="light"] .erp-section-card,
[data-theme="light"] .erp-card,
[data-theme="light"] .erp-form-shell,
[data-theme="light"] .erp-metric-tile,
[data-theme="light"] .erp-workspace-topbar,
[data-theme="light"] .erp-table-shell {
  background: var(--rp-surface);
  border-color: var(--rp-border);
  color: var(--rp-text);
}

[data-theme="dark"] .erp-section-card,
[data-theme="dark"] .erp-card,
[data-theme="dark"] .erp-form-shell,
[data-theme="dark"] .erp-metric-tile,
[data-theme="dark"] .erp-workspace-topbar,
[data-theme="dark"] .erp-table-shell {
  background: var(--rp-surface);
  border-color: var(--rp-border);
  color: var(--rp-text);
}

[data-theme="light"] .erp-input,
[data-theme="light"] .erp-search,
[data-theme="light"] .erp-sidebar-search {
  background: #ffffff;
  color: var(--rp-text);
  border-color: var(--rp-border);
}

[data-theme="dark"] .erp-input,
[data-theme="dark"] .erp-search,
[data-theme="dark"] .erp-sidebar-search {
  background: #070b14;
  color: var(--rp-text);
  border-color: var(--rp-border);
}

.erp-sidebar {
  transition: width 0.22s ease, min-width 0.22s ease, max-width 0.22s ease, padding 0.22s ease;
}

.erp-sidebar.is-collapsed {
  width: 70px;
  min-width: 70px;
  max-width: 70px;
  padding: 18px 10px;
}

.erp-sidebar-top-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.erp-sidebar.is-collapsed .erp-sidebar-top-actions {
  justify-content: center;
}

.erp-sidebar-icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.10);
  color: var(--rp-gold);
  cursor: pointer;
  font-weight: 900;
  transition: 0.2s ease;
}

.erp-sidebar-icon-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  transform: translateY(-1px);
}

.erp-sidebar.is-collapsed .erp-brand {
  justify-content: center;
}

.erp-sidebar.is-collapsed .erp-brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
}

.erp-theme-toggle {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.20);
  background: rgba(245, 158, 11, 0.08);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  transition: 0.2s ease;
}

.erp-theme-toggle:hover {
  background: rgba(245, 158, 11, 0.15);
}

.erp-theme-toggle span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #070b14;
  font-weight: 900;
}

.erp-theme-toggle strong {
  font-size: 13px;
  color: #fff;
}

.erp-sidebar.is-collapsed .erp-theme-toggle {
  padding: 0;
}

.erp-sidebar-search-wrap {
  position: relative;
  margin-bottom: 14px;
}

.erp-sidebar-search {
  width: 100%;
  min-height: 42px;
  padding: 0 14px 0 38px;
  border-radius: 15px;
  outline: none;
  font-size: 13px;
  font-weight: 700;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.erp-sidebar-search:focus {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08);
}

.erp-sidebar-search-wrap button {
  position: absolute;
  left: 8px;
  top: 7px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--rp-text-soft);
  cursor: pointer;
  font-weight: 900;
}

.erp-sidebar-empty {
  padding: 14px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px dashed rgba(148, 163, 184, 0.16);
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.erp-nav-item {
  position: relative;
}

.erp-nav-group-header {
  width: 100%;
  text-align: right;
  cursor: pointer;
}

.erp-nav-icon {
  width: 28px;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(245, 158, 11, 0.10);
  color: var(--rp-gold);
  font-size: 14px;
  line-height: 1;
}

.erp-sidebar.is-collapsed .erp-nav {
  gap: 10px;
}

.erp-sidebar.is-collapsed .erp-nav-item {
  justify-content: center;
  padding: 10px;
  min-height: 48px;
}

.erp-sidebar.is-collapsed .erp-nav-icon {
  width: 34px;
  min-width: 34px;
  height: 34px;
}

.erp-sidebar.is-collapsed .erp-nav-group-children {
  display: none;
}

.erp-logout-btn {
  gap: 10px;
}

.erp-logout-btn span {
  font-size: 15px;
}

.erp-sidebar.is-collapsed .erp-sidebar-footer {
  margin-top: 16px;
  padding-top: 14px;
}

.erp-sidebar.is-collapsed .erp-logout-btn {
  height: 44px;
  padding: 0;
}

.erp-sidebar.is-collapsed .erp-logout-btn span {
  display: block;
}

[data-theme="light"] .erp-sidebar,
[data-theme="light"] .erp-mobile-sidebar {
  background:
    radial-gradient(circle at top right, rgba(201, 166, 107, 0.16), transparent 22%),
    linear-gradient(180deg, #08172f 0%, #0b1f4d 100%);
}

[data-theme="light"] .erp-theme-toggle strong,
[data-theme="light"] .erp-brand-text h2,
[data-theme="light"] .erp-nav-item-label,
[data-theme="light"] .erp-logout-btn {
  color: #ffffff;
}

@media (max-width: 991px) {
  .erp-sidebar.is-collapsed {
    width: 88vw;
    min-width: auto;
    max-width: 360px;
    padding: 22px 16px 18px;
  }
}

/* ============================================================
   Royal Palace - Full Theme Switch (Light / Dark)
   Default: Light Mode (everything light, sidebar white)
   Toggle: data-theme="dark" on <html> = full dark mode
   ============================================================ */

:root {
  --rp-bg-main: #f3f5f9;
  --rp-bg-soft: #eef2f7;
  --rp-surface-1: #ffffff;
  --rp-surface-2: #f8fafc;
  --rp-surface-3: #f1f5f9;
  --rp-text-1: #0f172a;
  --rp-text-2: #334155;
  --rp-text-3: #64748b;
  --rp-text-muted-l: #94a3b8;
  --rp-border-1: #e2e8f0;
  --rp-border-2: #cbd5e1;
  --rp-shadow-1: 0 8px 24px rgba(15, 23, 42, 0.06);
  --rp-shadow-2: 0 16px 40px rgba(15, 23, 42, 0.10);
  --rp-sidebar-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --rp-sidebar-text: #0f172a;
  --rp-sidebar-text-soft: #475569;
  --rp-sidebar-text-muted: #64748b;
  --rp-sidebar-border: #e2e8f0;
  --rp-sidebar-hover: rgba(245, 158, 11, 0.08);
  --rp-sidebar-active-bg: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.06));
  --rp-sidebar-active-color: #b45309;
  --rp-input-bg: #ffffff;
  --rp-input-border: #cbd5e1;
  --rp-input-text: #0f172a;
}

html[data-theme="dark"] {
  --rp-bg-main: #050810;
  --rp-bg-soft: #0a0f1f;
  --rp-surface-1: #0c1224;
  --rp-surface-2: #0a1024;
  --rp-surface-3: #060916;
  --rp-text-1: #f8fafc;
  --rp-text-2: #cbd5e1;
  --rp-text-3: #94a3b8;
  --rp-text-muted-l: #64748b;
  --rp-border-1: rgba(255, 255, 255, 0.08);
  --rp-border-2: rgba(255, 255, 255, 0.14);
  --rp-shadow-1: 0 8px 24px rgba(0, 0, 0, 0.30);
  --rp-shadow-2: 0 16px 40px rgba(0, 0, 0, 0.45);
  --rp-sidebar-bg: linear-gradient(180deg, #0a1024 0%, #060916 100%);
  --rp-sidebar-text: #f1f5f9;
  --rp-sidebar-text-soft: rgba(255, 255, 255, 0.78);
  --rp-sidebar-text-muted: rgba(255, 255, 255, 0.45);
  --rp-sidebar-border: rgba(245, 158, 11, 0.10);
  --rp-sidebar-hover: rgba(255, 255, 255, 0.06);
  --rp-sidebar-active-bg: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(245, 158, 11, 0.06));
  --rp-sidebar-active-color: #fbbf24;
  --rp-input-bg: rgba(255, 255, 255, 0.04);
  --rp-input-border: rgba(255, 255, 255, 0.10);
  --rp-input-text: #f8fafc;
}

html, body {
  background: var(--rp-bg-main) !important;
  color: var(--rp-text-1) !important;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.erp-shell, .rp-dash-shell {
  background:
    radial-gradient(circle at 78% 18%, rgba(245, 158, 11, 0.06), transparent 26%),
    var(--rp-bg-main) !important;
  color: var(--rp-text-1) !important;
}

.rp-sidebar, .rp-sidebar-mobile {
  background: var(--rp-sidebar-bg) !important;
  color: var(--rp-sidebar-text) !important;
  border-left: 1px solid var(--rp-sidebar-border) !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="dark"] .rp-sidebar,
html[data-theme="dark"] .rp-sidebar-mobile {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45) !important;
}

.rp-sidebar-brand,
.rp-mobile-head {
  border-bottom-color: var(--rp-sidebar-border) !important;
}

.rp-sidebar-brand-text h2 { color: var(--rp-sidebar-text) !important; }
.rp-sidebar-brand-text p { color: #d97706 !important; }

.rp-search-input {
  background: var(--rp-input-bg) !important;
  border-color: var(--rp-input-border) !important;
  color: var(--rp-input-text) !important;
}

.rp-search-input::placeholder { color: var(--rp-text-muted-l) !important; }

.rp-search-icon { color: var(--rp-text-3) !important; }

.rp-search-wrap.focused .rp-search-input {
  background: rgba(245, 158, 11, 0.06) !important;
  border-color: rgba(245, 158, 11, 0.42) !important;
}

.rp-sidebar-current {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.10), rgba(245, 158, 11, 0.02)) !important;
  border-color: rgba(245, 158, 11, 0.20) !important;
}

.rp-sidebar-current-label { color: var(--rp-sidebar-text-muted) !important; }
.rp-sidebar-current-value { color: #d97706 !important; }
html[data-theme="dark"] .rp-sidebar-current-value { color: #fbbf24 !important; }

.rp-sidebar-profile {
  background: var(--rp-surface-2) !important;
  border-color: var(--rp-border-1) !important;
}

html[data-theme="dark"] .rp-sidebar-profile {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

.rp-profile-name { color: var(--rp-sidebar-text) !important; }
.rp-profile-key { color: var(--rp-sidebar-text-muted) !important; }
.rp-profile-row strong { color: #d97706 !important; }
html[data-theme="dark"] .rp-profile-row strong { color: #fbbf24 !important; }

.rp-profile-status { border-color: var(--rp-surface-1) !important; }
html[data-theme="dark"] .rp-profile-status { border-color: #0a1024 !important; }

.rp-theme-toggle {
  background: var(--rp-surface-2) !important;
  border-color: var(--rp-border-1) !important;
  color: var(--rp-text-1) !important;
}

html[data-theme="dark"] .rp-theme-toggle {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

.rp-theme-toggle:hover {
  background: rgba(245, 158, 11, 0.10) !important;
  border-color: rgba(245, 158, 11, 0.32) !important;
  color: #d97706 !important;
}

html[data-theme="dark"] .rp-theme-toggle:hover { color: #fbbf24 !important; }

.rp-sidebar-section-title { color: var(--rp-sidebar-text-muted) !important; }

.rp-nav-item,
.rp-nav-group-head {
  color: var(--rp-sidebar-text-soft) !important;
}

.rp-nav-item:hover,
.rp-nav-group-head:hover {
  background: var(--rp-sidebar-hover) !important;
  color: var(--rp-sidebar-text) !important;
}

.rp-nav-active {
  background: var(--rp-sidebar-active-bg) !important;
  color: var(--rp-sidebar-active-color) !important;
  border-color: rgba(245, 158, 11, 0.34) !important;
}

.rp-nav-label { color: inherit !important; }
.rp-nav-hint { color: var(--rp-sidebar-text-muted) !important; }
.rp-nav-active .rp-nav-hint { color: rgba(180, 83, 9, 0.85) !important; }
html[data-theme="dark"] .rp-nav-active .rp-nav-hint { color: rgba(251, 191, 36, 0.7) !important; }

.rp-nav-bullet { background: var(--rp-text-muted-l) !important; }
.rp-nav-item:hover .rp-nav-bullet { background: rgba(245, 158, 11, 0.6) !important; }
.rp-nav-active .rp-nav-bullet { background: #f59e0b !important; }

.rp-group-icon {
  background: var(--rp-surface-3) !important;
}

html[data-theme="dark"] .rp-group-icon {
  background: rgba(255, 255, 255, 0.05) !important;
}

.rp-group-open .rp-group-icon { background: rgba(245, 158, 11, 0.14) !important; }

.rp-chevron { color: var(--rp-text-3) !important; }
.rp-chevron.open { color: #d97706 !important; }
html[data-theme="dark"] .rp-chevron.open { color: #fbbf24 !important; }

.rp-nav-group-body { border-right-color: rgba(245, 158, 11, 0.18) !important; }

.rp-sidebar-footer { border-top-color: var(--rp-sidebar-border) !important; }

.rp-sidebar-version { color: var(--rp-text-muted-l) !important; }

.rp-mobile-title { color: #d97706 !important; }
html[data-theme="dark"] .rp-mobile-title { color: #fbbf24 !important; }

/* ============================================================
   Dashboard Pro - Light Mode adjustments
   ============================================================ */
.rp-topbar,
.rp-hero,
.rp-panel,
.rp-kpi-card,
.rp-factory-card,
.rp-status-bar {
  background: var(--rp-surface-1) !important;
  border-color: var(--rp-border-1) !important;
  box-shadow: var(--rp-shadow-1) !important;
}

html[data-theme="dark"] .rp-topbar,
html[data-theme="dark"] .rp-status-bar {
  background: rgba(12, 18, 36, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] .rp-hero {
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.10), rgba(59, 130, 246, 0.08)),
    linear-gradient(135deg, #0c1224 0%, #070b14 100%) !important;
  border-color: rgba(245, 158, 11, 0.16) !important;
}

html[data-theme="dark"] .rp-panel,
html[data-theme="dark"] .rp-kpi-card,
html[data-theme="dark"] .rp-factory-card {
  background: linear-gradient(135deg, rgba(12, 18, 36, 0.92) 0%, rgba(10, 15, 31, 0.92) 100%) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32) !important;
}

.rp-topbar-title { color: var(--rp-text-1) !important; }
.rp-topbar-sub { color: var(--rp-text-3) !important; }

.rp-period-btn { color: var(--rp-text-3) !important; }
.rp-period-btn:hover { color: var(--rp-text-1) !important; background: var(--rp-surface-3) !important; }
.rp-period-btn.active { color: #050810 !important; background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important; }

.rp-topbar-center {
  background: var(--rp-surface-2) !important;
  border-color: var(--rp-border-1) !important;
}

html[data-theme="dark"] .rp-topbar-center {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

.rp-icon-btn {
  background: var(--rp-surface-2) !important;
  border-color: var(--rp-border-1) !important;
  color: var(--rp-text-1) !important;
}

html[data-theme="dark"] .rp-icon-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

.rp-icon-btn:hover {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.32) !important;
}

.rp-clock {
  background: rgba(245, 158, 11, 0.08) !important;
  border-color: rgba(245, 158, 11, 0.20) !important;
}

.rp-clock-time { color: #d97706 !important; }
html[data-theme="dark"] .rp-clock-time { color: #fbbf24 !important; }
.rp-clock-date { color: var(--rp-text-3) !important; }

.rp-hero-title { color: var(--rp-text-1) !important; }
html[data-theme="dark"] .rp-hero-title { color: #f8fafc !important; }
.rp-hero-subtitle { color: var(--rp-text-2) !important; }
html[data-theme="dark"] .rp-hero-subtitle { color: #cbd5e1 !important; }
.rp-hero-eyebrow { color: #d97706 !important; }
html[data-theme="dark"] .rp-hero-eyebrow { color: #fbbf24 !important; }

.rp-hero-pill {
  background: var(--rp-surface-2) !important;
  border-color: var(--rp-border-1) !important;
  color: var(--rp-text-1) !important;
}

html[data-theme="dark"] .rp-hero-pill {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  color: #f8fafc !important;
}

.rp-panel-title { color: var(--rp-text-1) !important; }
.rp-panel-sub { color: var(--rp-text-3) !important; }

.rp-kpi-label { color: var(--rp-text-3) !important; }
.rp-kpi-value { color: var(--rp-text-1) !important; }
.rp-kpi-note { color: var(--rp-text-muted-l) !important; }

html[data-theme="dark"] .rp-kpi-value { color: #f8fafc !important; }

.rp-factory-name { color: var(--rp-text-1) !important; }
html[data-theme="dark"] .rp-factory-name { color: #f8fafc !important; }
.rp-factory-stat {
  background: var(--rp-surface-2) !important;
  border-color: var(--rp-border-1) !important;
}
html[data-theme="dark"] .rp-factory-stat {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
}
.rp-factory-stat-label { color: var(--rp-text-3) !important; }
.rp-factory-stat-value { color: var(--rp-text-1) !important; }
html[data-theme="dark"] .rp-factory-stat-value { color: #f8fafc !important; }

.rp-product-row {
  background: var(--rp-surface-2) !important;
  border-color: var(--rp-border-1) !important;
}
html[data-theme="dark"] .rp-product-row {
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
}
.rp-product-name { color: var(--rp-text-1) !important; }
html[data-theme="dark"] .rp-product-name { color: #f8fafc !important; }

.rp-insight,
.rp-feed-item {
  background: var(--rp-surface-2) !important;
  border-color: var(--rp-border-1) !important;
}
html[data-theme="dark"] .rp-insight,
html[data-theme="dark"] .rp-feed-item {
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
}
.rp-insight-title,
.rp-feed-title { color: var(--rp-text-1) !important; }
html[data-theme="dark"] .rp-insight-title,
html[data-theme="dark"] .rp-feed-title { color: #f8fafc !important; }
.rp-insight-desc { color: var(--rp-text-3) !important; }
.rp-feed-meta { color: var(--rp-text-muted-l) !important; }

.rp-tabs {
  background: var(--rp-surface-1) !important;
  border-color: var(--rp-border-1) !important;
}
html[data-theme="dark"] .rp-tabs {
  background: rgba(12, 18, 36, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}
.rp-tab { color: var(--rp-text-3) !important; }
.rp-tab:hover { color: var(--rp-text-1) !important; background: var(--rp-surface-3) !important; }
.rp-tab.active { color: #050810 !important; background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important; }

.rp-quick-link {
  background: var(--rp-surface-2) !important;
  border-color: var(--rp-border-1) !important;
  color: var(--rp-text-1) !important;
}
html[data-theme="dark"] .rp-quick-link {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  color: #f8fafc !important;
}
.rp-quick-link:hover {
  background: rgba(245, 158, 11, 0.10) !important;
  border-color: rgba(245, 158, 11, 0.32) !important;
  color: #d97706 !important;
}
html[data-theme="dark"] .rp-quick-link:hover { color: #fbbf24 !important; }

.rp-status-item { color: var(--rp-text-3) !important; }

/* Tables in light mode */
.erp-table th {
  background: var(--rp-surface-2) !important;
  color: var(--rp-text-2) !important;
}
.erp-table td { color: var(--rp-text-1) !important; }
.erp-table th, .erp-table td { border-bottom-color: var(--rp-border-1) !important; }
.erp-table-shell { border-color: var(--rp-border-1) !important; }
html[data-theme="dark"] .erp-table th {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .erp-table td { color: #f8fafc !important; }
html[data-theme="dark"] .erp-table th,
html[data-theme="dark"] .erp-table td,
html[data-theme="dark"] .erp-table-shell { border-color: rgba(255, 255, 255, 0.08) !important; }

/* Form inputs */
.erp-input, .erp-search {
  background: var(--rp-input-bg) !important;
  border-color: var(--rp-input-border) !important;
  color: var(--rp-input-text) !important;
}

/* Section cards generic */
.erp-section-card, .erp-card, .erp-form-shell {
  background: var(--rp-surface-1) !important;
  border-color: var(--rp-border-1) !important;
  color: var(--rp-text-1) !important;
  box-shadow: var(--rp-shadow-1) !important;
}
html[data-theme="dark"] .erp-section-card,
html[data-theme="dark"] .erp-card,
html[data-theme="dark"] .erp-form-shell {
  background: linear-gradient(135deg, rgba(12, 18, 36, 0.92) 0%, rgba(10, 15, 31, 0.92) 100%) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  color: #f8fafc !important;
}

:root,
[data-theme="light"],
[data-theme="dark"] {
  --rp-bg: #070b14;
  --rp-bg-soft: #0c1224;
  --rp-surface: #0c1224;
  --rp-surface-2: #070b14;
  --rp-border: #1e293b;
  --rp-border-strong: #334155;
  --rp-text: #f8fafc;
  --rp-text-soft: #cbd5e1;
  --rp-text-muted: #64748b;
  --rp-gold: #fbbf24;
  --rp-gold-strong: #f59e0b;
  --rp-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  --rp-shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.3);
}

html,
body,
[data-theme="light"] body,
[data-theme="dark"] body,
[data-theme="light"] .erp-shell,
[data-theme="dark"] .erp-shell {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0c1224 100%) !important;
  color: var(--rp-text) !important;
}

.erp-theme-toggle {
  display: none !important;
}

.erp-nav-icon svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.erp-nav-item.active .erp-nav-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(245, 158, 11, 0.08));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.22);
}

.erp-nav-group-header .erp-nav-icon {
  background: rgba(255, 255, 255, 0.06);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.16);
}

.erp-sidebar.is-collapsed .erp-nav-icon svg {
  width: 18px;
  height: 18px;
}

/* ========== Royal Palace Sidebar Pro v2 ========== */
.rp-sidebar {
  width: 290px;
  min-width: 290px;
  max-width: 290px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0a1024 0%, #060916 100%);
  color: #f1f5f9;
  padding: 18px 14px;
  flex-shrink: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  align-self: flex-start;
  border-left: 1px solid rgba(245, 158, 11, 0.10);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.3) transparent;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-sidebar::-webkit-scrollbar { width: 6px; }
.rp-sidebar::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 999px;
}
.rp-sidebar::-webkit-scrollbar-track { background: transparent; }

.rp-sidebar-collapsed {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  padding: 18px 8px;
}

.rp-sidebar-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-sidebar-brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.32),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.rp-brand-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  border: 2px solid rgba(245, 158, 11, 0.5);
  opacity: 0;
  animation: rpBrandPulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes rpBrandPulse {
  0% { opacity: 0.7; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.18); }
}

.rp-sidebar-brand-text {
  flex: 1 1;
  min-width: 0;
}

.rp-sidebar-brand-text h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.rp-sidebar-brand-text p {
  margin: 3px 0 0;
  font-size: 10px;
  color: rgba(245, 158, 11, 0.85);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-collapse-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  transform: translateX(-2px);
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.rp-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.rp-search-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  pointer-events: none;
}

.rp-search-input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  padding: 0 30px 0 30px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.rp-search-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.rp-search-wrap.focused .rp-search-input {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.06);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.rp-search-clear {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.rp-search-clear:hover { background: rgba(239, 68, 68, 0.3); }

.rp-sidebar-current {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.rp-sidebar-current-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.rp-sidebar-current-value {
  font-size: 13px;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: -0.2px;
}

.rp-sidebar-profile {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-profile-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.32);
}

.rp-profile-status {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0a1024;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.rp-profile-info {
  flex: 1 1;
  min-width: 0;
}

.rp-profile-name {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-profile-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  margin-top: 2px;
}

.rp-profile-key { color: rgba(255, 255, 255, 0.55); font-weight: 700; }
.rp-profile-row strong { color: #fbbf24; font-weight: 800; font-size: 10px; }

.rp-theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  margin-bottom: 12px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  justify-content: center;
}

.rp-theme-toggle:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
  transform: translateY(-1px);
}

.rp-theme-icon {
  font-size: 16px;
  line-height: 1;
}

.rp-sidebar-collapsed .rp-theme-toggle {
  padding: 0;
  height: 42px;
}

.rp-sidebar-section-title {
  margin: 14px 0 8px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rp-nav {
  display: grid;
  grid-gap: 3px;
  gap: 3px;
}

.rp-nav-group {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  margin-bottom: 4px;
}

.rp-nav-group-body {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  padding: 4px 0 6px 0;
  margin-right: 4px;
  border-right: 2px solid rgba(245, 158, 11, 0.14);
  animation: rpFadeSlide 0.22s ease-out;
}

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

.rp-nav-item,
.rp-nav-group-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-nav-item:hover,
.rp-nav-group-head:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  transform: translateX(-2px);
}

.rp-nav-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(245, 158, 11, 0.06));
  border-color: rgba(245, 158, 11, 0.34);
  color: #fbbf24 !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rp-nav-active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: -14px;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.rp-sidebar-collapsed .rp-nav-active::before {
  right: -8px;
}

.rp-nav-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-item:hover .rp-nav-bullet { background: rgba(245, 158, 11, 0.6); }
.rp-nav-active .rp-nav-bullet {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.rp-nav-child .rp-nav-bullet { width: 4px; height: 4px; }

.rp-group-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-group-head:hover .rp-group-icon {
  background: rgba(245, 158, 11, 0.16);
  transform: scale(1.05);
}

.rp-group-open .rp-group-icon {
  background: rgba(245, 158, 11, 0.14);
}

.rp-nav-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1;
  min-width: 0;
}

.rp-nav-label {
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-active .rp-nav-hint { color: rgba(251, 191, 36, 0.7); }

.rp-nav-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
  flex-shrink: 0;
  animation: rpDotPulse 1.6s ease-in-out infinite;
}

@keyframes rpDotPulse {
  50% { opacity: 0.5; transform: scale(0.85); }
}

.rp-chevron {
  font-weight: 900;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.rp-chevron.open { transform: rotate(90deg); color: #fbbf24; }

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  padding: 10px;
  justify-content: center;
}

.rp-sidebar-collapsed .rp-nav-bullet { display: none; }
.rp-sidebar-collapsed .rp-group-icon {
  width: 32px; height: 32px; font-size: 16px;
}

.rp-nav-empty {
  text-align: center;
  padding: 30px 14px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 700;
}

.rp-sidebar-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-logout-btn {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.rp-logout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.42);
  transform: translateY(-1px);
}

.rp-logout-icon { font-size: 16px; }

.rp-sidebar-version {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
}

.rp-status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: rpDotPulse 2s ease-in-out infinite;
}

.rp-mobile-menu-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1400;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.32);
}

.rp-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 1498;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: rpFadeIn 0.22s ease-out;
}

.rp-sidebar-mobile {
  position: fixed;
  top: 0;
  right: 0;
  width: 88vw;
  max-width: 340px;
  height: 100vh;
  z-index: 1499;
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.55);
  animation: rpSlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rpSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.rp-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rp-mobile-title {
  font-size: 16px;
  font-weight: 900;
  color: #fbbf24;
}

.rp-mobile-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 991px) {
  .rp-sidebar { display: none; }
  .erp-shell { display: block; }
  .erp-main, .rp-dash-main { padding-top: 80px; }
}

[data-theme="dark"] {
  --rp-bg: #0a1024;
  --rp-surface: #0c1224;
  --rp-text: #f8fafc;
  --rp-border: rgba(245, 158, 11, 0.12);
}

/* ========== Royal Palace Sidebar Pro v2 ========== */
.rp-sidebar {
  width: 290px;
  min-width: 290px;
  max-width: 290px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0a1024 0%, #060916 100%);
  color: #f1f5f9;
  padding: 18px 14px;
  flex-shrink: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  align-self: flex-start;
  border-left: 1px solid rgba(245, 158, 11, 0.10);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.3) transparent;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-sidebar::-webkit-scrollbar { width: 6px; }
.rp-sidebar::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 999px;
}
.rp-sidebar::-webkit-scrollbar-track { background: transparent; }

.rp-sidebar-collapsed {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  padding: 18px 8px;
}

.rp-sidebar-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-sidebar-brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.32),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.rp-brand-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  border: 2px solid rgba(245, 158, 11, 0.5);
  opacity: 0;
  animation: rpBrandPulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes rpBrandPulse {
  0% { opacity: 0.7; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.18); }
}

.rp-sidebar-brand-text {
  flex: 1 1;
  min-width: 0;
}

.rp-sidebar-brand-text h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.rp-sidebar-brand-text p {
  margin: 3px 0 0;
  font-size: 10px;
  color: rgba(245, 158, 11, 0.85);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-collapse-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  transform: translateX(-2px);
}

.rp-sidebar-collapsed .rp-collapse-btn {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.rp-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.rp-search-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  pointer-events: none;
}

.rp-search-input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  padding: 0 30px 0 30px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.rp-search-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.rp-search-wrap.focused .rp-search-input {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.06);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.rp-search-clear {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.rp-search-clear:hover { background: rgba(239, 68, 68, 0.3); }

.rp-sidebar-current {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.rp-sidebar-current-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.rp-sidebar-current-value {
  font-size: 13px;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: -0.2px;
}

.rp-sidebar-profile {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-profile-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.32);
}

.rp-profile-status {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0a1024;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.rp-profile-info {
  flex: 1 1;
  min-width: 0;
}

.rp-profile-name {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-profile-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  margin-top: 2px;
}

.rp-profile-key { color: rgba(255, 255, 255, 0.55); font-weight: 700; }
.rp-profile-row strong { color: #fbbf24; font-weight: 800; font-size: 10px; }

.rp-theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  margin-bottom: 12px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  justify-content: center;
}

.rp-theme-toggle:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
  transform: translateY(-1px);
}

.rp-theme-icon {
  font-size: 16px;
  line-height: 1;
}

.rp-sidebar-collapsed .rp-theme-toggle {
  padding: 0;
  height: 42px;
}

.rp-sidebar-section-title {
  margin: 14px 0 8px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rp-nav {
  display: grid;
  grid-gap: 3px;
  gap: 3px;
}

.rp-nav-group {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  margin-bottom: 4px;
}

.rp-nav-group-body {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  padding: 4px 0 6px 0;
  margin-right: 4px;
  border-right: 2px solid rgba(245, 158, 11, 0.14);
  animation: rpFadeSlide 0.22s ease-out;
}

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

.rp-nav-item,
.rp-nav-group-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.rp-nav-item:hover,
.rp-nav-group-head:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  transform: translateX(-2px);
}

.rp-nav-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(245, 158, 11, 0.06));
  border-color: rgba(245, 158, 11, 0.34);
  color: #fbbf24 !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rp-nav-active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: -14px;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.rp-sidebar-collapsed .rp-nav-active::before {
  right: -8px;
}

.rp-nav-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-item:hover .rp-nav-bullet { background: rgba(245, 158, 11, 0.6); }
.rp-nav-active .rp-nav-bullet {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.rp-nav-child .rp-nav-bullet { width: 4px; height: 4px; }

.rp-group-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rp-nav-group-head:hover .rp-group-icon {
  background: rgba(245, 158, 11, 0.16);
  transform: scale(1.05);
}

.rp-group-open .rp-group-icon {
  background: rgba(245, 158, 11, 0.14);
}

.rp-nav-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1;
  min-width: 0;
}

.rp-nav-label {
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-nav-active .rp-nav-hint { color: rgba(251, 191, 36, 0.7); }

.rp-nav-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
  flex-shrink: 0;
  animation: rpDotPulse 1.6s ease-in-out infinite;
}

@keyframes rpDotPulse {
  50% { opacity: 0.5; transform: scale(0.85); }
}

.rp-chevron {
  font-weight: 900;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.rp-chevron.open { transform: rotate(90deg); color: #fbbf24; }

.rp-sidebar-collapsed .rp-nav-item,
.rp-sidebar-collapsed .rp-nav-group-head {
  padding: 10px;
  justify-content: center;
}

.rp-sidebar-collapsed .rp-nav-bullet { display: none; }
.rp-sidebar-collapsed .rp-group-icon {
  width: 32px; height: 32px; font-size: 16px;
}

.rp-nav-empty {
  text-align: center;
  padding: 30px 14px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 700;
}

.rp-sidebar-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-logout-btn {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.rp-logout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.42);
  transform: translateY(-1px);
}

.rp-logout-icon { font-size: 16px; }

.rp-sidebar-version {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
}

.rp-status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: rpDotPulse 2s ease-in-out infinite;
}

.rp-mobile-menu-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1400;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.32);
}

.rp-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 1498;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: rpFadeIn 0.22s ease-out;
}

.rp-sidebar-mobile {
  position: fixed;
  top: 0;
  right: 0;
  width: 88vw;
  max-width: 340px;
  height: 100vh;
  z-index: 1499;
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.55);
  animation: rpSlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rpSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.rp-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rp-mobile-title {
  font-size: 16px;
  font-weight: 900;
  color: #fbbf24;
}

.rp-mobile-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 991px) {
  .rp-sidebar { display: none; }
  .erp-shell { display: block; }
  .erp-main, .rp-dash-main { padding-top: 80px; }
}

[data-theme="dark"] {
  --rp-bg: #0a1024;
  --rp-surface: #0c1224;
  --rp-text: #f8fafc;
  --rp-border: rgba(245, 158, 11, 0.12);
}

.rp-crm-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: #f8fafc;
}

.rp-crm-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
  grid-gap: 18px;
  gap: 18px;
  padding: 26px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 12% 14%, rgba(245, 158, 11, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(12, 18, 36, 0.98), rgba(7, 11, 20, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.rp-crm-eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.20);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rp-crm-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -0.8px;
}

.rp-crm-hero p {
  margin: 12px 0 0;
  max-width: 760px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.9;
}

.rp-crm-hero-side {
  display: grid;
  place-items: center;
  align-content: center;
  grid-gap: 8px;
  gap: 8px;
  border-radius: 22px;
  background: rgba(7, 11, 20, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.rp-crm-hero-side strong {
  color: #fbbf24;
  font-size: 30px;
  font-weight: 950;
}

.rp-crm-hero-side span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
}

.rp-crm-message {
  padding: 12px 14px;
  border-radius: 14px;
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.20);
  font-size: 13px;
  font-weight: 800;
}

.rp-crm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.rp-crm-search {
  position: relative;
  flex: 1 1;
}

.rp-crm-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px 0 44px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(7, 11, 20, 0.68);
  color: #f8fafc;
  outline: none;
  font-size: 13px;
  font-weight: 700;
}

.rp-crm-search input:focus {
  border-color: rgba(245, 158, 11, 0.42);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08);
}

.rp-crm-search button {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.rp-crm-toolbar > button,
.rp-crm-form button,
.rp-crm-export button {
  min-height: 42px;
  padding: 0 14px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #070b14;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.rp-crm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-gap: 14px;
  gap: 14px;
}

.rp-crm-kpi {
  position: relative;
  min-height: 136px;
  padding: 18px;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(12, 18, 36, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.rp-crm-kpi-glow {
  position: absolute;
  top: -30px;
  left: -30px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  opacity: 0.12;
  background: currentColor;
}

.rp-crm-kpi span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
}

.rp-crm-kpi strong {
  display: block;
  margin-top: 14px;
  color: #fff;
  font-size: 26px;
  font-weight: 950;
}

.rp-crm-kpi small {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.rp-crm-kpi.gold { color: #f59e0b; }
.rp-crm-kpi.blue { color: #60a5fa; }
.rp-crm-kpi.green { color: #34d399; }
.rp-crm-kpi.red { color: #f87171; }
.rp-crm-kpi.purple { color: #a78bfa; }
.rp-crm-kpi.cyan { color: #22d3ee; }

.rp-crm-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-crm-tabs button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.rp-crm-tabs button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.rp-crm-tabs button.active {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
}

.rp-crm-grid {
  display: grid;
  grid-gap: 18px;
  gap: 18px;
}

.rp-crm-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rp-crm-grid.two.compact {
  gap: 12px;
}

.rp-crm-panel {
  padding: 18px;
  border-radius: 22px;
  background: rgba(12, 18, 36, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.rp-crm-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.rp-crm-panel h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 17px;
  font-weight: 950;
}

.rp-crm-panel p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.rp-crm-export {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.rp-crm-export button {
  min-height: 34px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rp-crm-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.rp-crm-form textarea,
.rp-crm-form button {
  grid-column: 1 / -1;
}

.rp-crm-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(7, 11, 20, 0.70);
  color: #f8fafc;
  outline: none;
  font-size: 12px;
  font-weight: 700;
}

.rp-crm-input:focus {
  border-color: rgba(245, 158, 11, 0.42);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08);
}

.rp-crm-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.rp-crm-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.rp-crm-table th,
.rp-crm-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
  text-align: right;
  font-size: 12px;
}

.rp-crm-table th {
  background: rgba(7, 11, 20, 0.7);
  color: #94a3b8;
  font-weight: 950;
}

.rp-crm-table td {
  color: #cbd5e1;
  font-weight: 700;
}

.rp-crm-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--badge-color);
  background: color-mix(in srgb, var(--badge-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--badge-color) 24%, transparent);
  font-size: 10px;
  font-weight: 900;
}

.rp-crm-priority {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.rp-crm-priority.high { color: #f87171; background: rgba(239, 68, 68, 0.10); }
.rp-crm-priority.medium { color: #fbbf24; background: rgba(245, 158, 11, 0.10); }
.rp-crm-priority.low { color: #60a5fa; background: rgba(59, 130, 246, 0.10); }

.rp-crm-danger,
.rp-crm-open,
.rp-crm-done {
  min-height: 30px;
  padding: 0 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.rp-crm-danger { background: rgba(239, 68, 68, 0.12); color: #f87171; }
.rp-crm-open { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.rp-crm-done { background: rgba(34, 197, 94, 0.12); color: #34d399; }

.rp-crm-mini-bars {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
}

.rp-crm-mini-bar-label {
  display: flex;
  justify-content: space-between;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.rp-crm-mini-bar-label b {
  color: #f8fafc;
}

.rp-crm-mini-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
}

.rp-crm-mini-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.rp-crm-list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.08);
  margin-bottom: 8px;
}

.rp-crm-list-row strong {
  display: block;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}

.rp-crm-list-row span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.rp-crm-list-row b {
  color: #fbbf24;
  font-size: 12px;
  font-weight: 950;
}

.rp-crm-kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(260px, 1fr));
  grid-gap: 14px;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.rp-crm-kanban-col {
  min-height: 420px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.rp-crm-kanban-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--stage-color);
}

.rp-crm-kanban-head strong {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 950;
}

.rp-crm-kanban-head span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--stage-color) 18%, transparent);
  color: var(--stage-color);
  font-size: 12px;
  font-weight: 950;
}

.rp-crm-kanban-value {
  margin: 10px 0;
  color: #fbbf24;
  font-size: 12px;
  font-weight: 900;
}

.rp-crm-kanban-list {
  display: grid;
  grid-gap: 10px;
  gap: 10px;
}

.rp-crm-kanban-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.10);
}

.rp-crm-kanban-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.rp-crm-kanban-card strong {
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.rp-crm-kanban-card p {
  margin: 6px 0 0;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.6;
}

.rp-crm-kanban-card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: #fbbf24;
  font-size: 11px;
  font-weight: 900;
}

.rp-crm-kanban-card-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.rp-crm-kanban-card-actions button {
  min-height: 25px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.rp-crm-kanban-card-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.rp-crm-note-grid {
  display: grid;
  grid-gap: 10px;
  gap: 10px;
}

.rp-crm-note {
  padding: 14px;
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.10);
}

.rp-crm-note > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.rp-crm-note button {
  border: none;
  background: transparent;
  color: #f87171;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.rp-crm-note strong {
  display: block;
  margin-top: 10px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 950;
}

.rp-crm-note p {
  color: #94a3b8;
  line-height: 1.8;
  font-size: 12px;
}

.rp-crm-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  grid-gap: 8px;
  gap: 8px;
  overflow-x: auto;
}

.rp-crm-day {
  min-height: 110px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.10);
}

.rp-crm-day strong {
  color: #fbbf24;
  font-size: 12px;
  font-weight: 950;
}

.rp-crm-day span {
  display: block;
  margin-top: 6px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-crm-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: #64748b;
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.45);
  border: 1px dashed rgba(148, 163, 184, 0.18);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 1500px) {
  .rp-crm-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .rp-crm-hero,
  .rp-crm-grid.two,
  .rp-crm-grid.two.compact {
    grid-template-columns: 1fr;
  }

  .rp-crm-kanban {
    grid-template-columns: repeat(6, 280px);
  }
}

@media (max-width: 760px) {
  .rp-crm-kpi-grid,
  .rp-crm-form {
    grid-template-columns: 1fr;
  }

  .rp-crm-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .rp-crm-calendar {
    grid-template-columns: repeat(7, 110px);
  }
}

.rp-inv-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: #f8fafc;
}

.rp-inv-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(230px, 0.6fr);
  grid-gap: 18px;
  gap: 18px;
  padding: 26px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 12% 14%, rgba(245, 158, 11, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(12, 18, 36, 0.98), rgba(7, 11, 20, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.rp-inv-eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.20);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rp-inv-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -0.8px;
}

.rp-inv-hero p {
  margin: 12px 0 0;
  max-width: 760px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.9;
}

.rp-inv-hero-value {
  display: grid;
  place-items: center;
  align-content: center;
  grid-gap: 8px;
  gap: 8px;
  border-radius: 22px;
  background: rgba(7, 11, 20, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.rp-inv-hero-value strong {
  color: #fbbf24;
  font-size: 30px;
  font-weight: 950;
}

.rp-inv-hero-value span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
}

.rp-inv-message {
  padding: 12px 14px;
  border-radius: 14px;
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.20);
  font-size: 13px;
  font-weight: 800;
}

.rp-inv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.rp-inv-search {
  position: relative;
  flex: 1 1;
}

.rp-inv-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px 0 44px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(7, 11, 20, 0.68);
  color: #f8fafc;
  outline: none;
  font-size: 13px;
  font-weight: 700;
}

.rp-inv-search input:focus {
  border-color: rgba(245, 158, 11, 0.42);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08);
}

.rp-inv-search button {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.rp-inv-toolbar > button,
.rp-inv-form button,
.rp-inv-export button {
  min-height: 42px;
  padding: 0 14px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #070b14;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.rp-inv-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-gap: 14px;
  gap: 14px;
}

.rp-inv-kpi {
  position: relative;
  min-height: 136px;
  padding: 18px;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(12, 18, 36, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.rp-inv-kpi i {
  position: absolute;
  top: -30px;
  left: -30px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  opacity: 0.12;
  background: currentColor;
}

.rp-inv-kpi span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
}

.rp-inv-kpi strong {
  display: block;
  margin-top: 14px;
  color: #fff;
  font-size: 26px;
  font-weight: 950;
}

.rp-inv-kpi small {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.rp-inv-kpi.gold { color: #f59e0b; }
.rp-inv-kpi.blue { color: #60a5fa; }
.rp-inv-kpi.green { color: #34d399; }
.rp-inv-kpi.red { color: #f87171; }
.rp-inv-kpi.purple { color: #a78bfa; }
.rp-inv-kpi.cyan { color: #22d3ee; }

.rp-inv-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-inv-tabs button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.rp-inv-tabs button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.rp-inv-tabs button.active {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
}

.rp-inv-grid {
  display: grid;
  grid-gap: 18px;
  gap: 18px;
}

.rp-inv-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rp-inv-panel {
  padding: 18px;
  border-radius: 22px;
  background: rgba(12, 18, 36, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.rp-inv-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.rp-inv-panel h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 17px;
  font-weight: 950;
}

.rp-inv-panel p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.rp-inv-export {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.rp-inv-export button {
  min-height: 34px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rp-inv-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.rp-inv-form textarea,
.rp-inv-form button {
  grid-column: 1 / -1;
}

.rp-inv-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(7, 11, 20, 0.70);
  color: #f8fafc;
  outline: none;
  font-size: 12px;
  font-weight: 700;
}

.rp-inv-input:focus {
  border-color: rgba(245, 158, 11, 0.42);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08);
}

.rp-inv-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.rp-inv-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.rp-inv-table th,
.rp-inv-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
  text-align: right;
  font-size: 12px;
}

.rp-inv-table th {
  background: rgba(7, 11, 20, 0.7);
  color: #94a3b8;
  font-weight: 950;
}

.rp-inv-table td {
  color: #cbd5e1;
  font-weight: 700;
}

.rp-inv-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.rp-inv-badge.good { color: #34d399; background: rgba(34, 197, 94, 0.10); }
.rp-inv-badge.warn { color: #fbbf24; background: rgba(245, 158, 11, 0.10); }
.rp-inv-badge.danger { color: #f87171; background: rgba(239, 68, 68, 0.10); }
.rp-inv-badge.muted { color: #94a3b8; background: rgba(148, 163, 184, 0.10); }

.rp-inv-danger {
  min-height: 30px;
  padding: 0 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.rp-inv-feed {
  display: grid;
  grid-gap: 10px;
  gap: 10px;
}

.rp-inv-feed-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  grid-gap: 10px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.rp-inv-feed-row i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.rp-inv-feed-row i.good { background: #34d399; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.10); }
.rp-inv-feed-row i.warn { background: #fbbf24; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.10); }
.rp-inv-feed-row i.danger { background: #f87171; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.10); }
.rp-inv-feed-row i.muted { background: #94a3b8; }

.rp-inv-feed-row strong {
  display: block;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}

.rp-inv-feed-row span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.rp-inv-feed-row b {
  color: #fbbf24;
  font-size: 11px;
  font-weight: 950;
}

.rp-inv-ledger-select {
  max-width: 420px;
  margin-bottom: 14px;
}

.rp-inv-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: #64748b;
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.45);
  border: 1px dashed rgba(148, 163, 184, 0.18);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 1500px) {
  .rp-inv-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .rp-inv-hero,
  .rp-inv-grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .rp-inv-kpi-grid,
  .rp-inv-form {
    grid-template-columns: 1fr;
  }

  .rp-inv-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

.rp-inv-check {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  margin-top: 4px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
}

.rp-inv-check input {
  width: 16px;
  height: 16px;
  accent-color: #f59e0b;
}

.rp-inv-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
}

.rp-inv-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.rp-inv-small {
  padding: 4px 8px;
  font-size: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
}

.rp-inv-small:hover {
  background: rgba(255, 255, 255, 0.06);
}

.rp-inv-badge.mono {
  font-family: monospace;
}

.rp-crm-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: #f8fafc;
}

.rp-crm-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(230px, 0.6fr);
  grid-gap: 18px;
  gap: 18px;
  padding: 26px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 12% 14%, rgba(245, 158, 11, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(12, 18, 36, 0.98), rgba(7, 11, 20, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.rp-crm-eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.20);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rp-crm-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -0.8px;
}

.rp-crm-hero p {
  margin: 12px 0 0;
  max-width: 760px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.9;
}

.rp-crm-hero-value {
  display: grid;
  place-items: center;
  align-content: center;
  grid-gap: 8px;
  gap: 8px;
  border-radius: 22px;
  background: rgba(7, 11, 20, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.rp-crm-hero-value strong {
  color: #fbbf24;
  font-size: 30px;
  font-weight: 950;
}

.rp-crm-hero-value span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
}

.rp-crm-message {
  padding: 12px 14px;
  border-radius: 14px;
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.20);
  font-size: 13px;
  font-weight: 800;
}

.rp-crm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.rp-crm-search {
  position: relative;
  flex: 1 1;
}

.rp-crm-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px 0 44px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(7, 11, 20, 0.68);
  color: #f8fafc;
  outline: none;
  font-size: 13px;
  font-weight: 700;
}

.rp-crm-search input:focus {
  border-color: rgba(245, 158, 11, 0.42);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08);
}

.rp-crm-search button {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.rp-crm-toolbar > button,
.rp-crm-form button,
.rp-crm-export button {
  min-height: 42px;
  padding: 0 14px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #070b14;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.rp-crm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-gap: 14px;
  gap: 14px;
}

.rp-crm-kpi {
  position: relative;
  min-height: 136px;
  padding: 18px;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(12, 18, 36, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.rp-crm-kpi i {
  position: absolute;
  top: -30px;
  left: -30px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  opacity: 0.12;
  background: currentColor;
}

.rp-crm-kpi span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
}

.rp-crm-kpi strong {
  display: block;
  margin-top: 14px;
  color: #fff;
  font-size: 26px;
  font-weight: 950;
}

.rp-crm-kpi small {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.rp-crm-kpi.gold { color: #f59e0b; }
.rp-crm-kpi.blue { color: #60a5fa; }
.rp-crm-kpi.green { color: #34d399; }
.rp-crm-kpi.red { color: #f87171; }
.rp-crm-kpi.purple { color: #a78bfa; }
.rp-crm-kpi.cyan { color: #22d3ee; }

.rp-crm-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-crm-tabs button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.rp-crm-tabs button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.rp-crm-tabs button.active {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
}

.rp-crm-grid {
  display: grid;
  grid-gap: 18px;
  gap: 18px;
}

.rp-crm-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rp-crm-grid.two.compact {
  gap: 12px;
}

.rp-crm-panel {
  padding: 18px;
  border-radius: 22px;
  background: rgba(12, 18, 36, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.rp-crm-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.rp-crm-panel h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 17px;
  font-weight: 950;
}

.rp-crm-panel p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.rp-crm-export {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.rp-crm-export button {
  min-height: 34px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rp-crm-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.rp-crm-form textarea,
.rp-crm-form button {
  grid-column: 1 / -1;
}

.rp-crm-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(7, 11, 20, 0.70);
  color: #f8fafc;
  outline: none;
  font-size: 12px;
  font-weight: 700;
}

.rp-crm-input:focus {
  border-color: rgba(245, 158, 11, 0.42);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08);
}

.rp-crm-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.rp-crm-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.rp-crm-table th,
.rp-crm-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
  text-align: right;
  font-size: 12px;
}

.rp-crm-table th {
  background: rgba(7, 11, 20, 0.7);
  color: #94a3b8;
  font-weight: 950;
}

.rp-crm-table td {
  color: #cbd5e1;
  font-weight: 700;
}

.rp-crm-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.rp-crm-badge.good { color: #34d399; background: rgba(34, 197, 94, 0.10); }
.rp-crm-badge.warn { color: #fbbf24; background: rgba(245, 158, 11, 0.10); }
.rp-crm-badge.danger { color: #f87171; background: rgba(239, 68, 68, 0.10); }
.rp-crm-badge.muted { color: #94a3b8; background: rgba(148, 163, 184, 0.10); }

.rp-crm-priority {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.rp-crm-priority.high { color: #f87171; background: rgba(239, 68, 68, 0.10); }
.rp-crm-priority.medium { color: #fbbf24; background: rgba(245, 158, 11, 0.10); }
.rp-crm-priority.low { color: #60a5fa; background: rgba(59, 130, 246, 0.10); }

.rp-crm-danger,
.rp-crm-open,
.rp-crm-done {
  min-height: 30px;
  padding: 0 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.rp-crm-danger { background: rgba(239, 68, 68, 0.12); color: #f87171; }
.rp-crm-open { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.rp-crm-done { background: rgba(34, 197, 94, 0.12); color: #34d399; }

.rp-crm-mini-bars {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
}

.rp-crm-mini-bar-label {
  display: flex;
  justify-content: space-between;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.rp-crm-mini-bar-label b {
  color: #f8fafc;
}

.rp-crm-mini-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
}

.rp-crm-mini-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.rp-crm-list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.08);
  margin-bottom: 8px;
}

.rp-crm-list-row strong {
  display: block;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}

.rp-crm-list-row span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.rp-crm-list-row b {
  color: #fbbf24;
  font-size: 12px;
  font-weight: 950;
}

.rp-crm-kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(260px, 1fr));
  grid-gap: 14px;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.rp-crm-kanban-col {
  min-height: 420px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.rp-crm-kanban-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--stage-color);
}

.rp-crm-kanban-head strong {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 950;
}

.rp-crm-kanban-head span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--stage-color) 18%, transparent);
  color: var(--stage-color);
  font-size: 12px;
  font-weight: 950;
}

.rp-crm-kanban-value {
  margin: 10px 0;
  color: #fbbf24;
  font-size: 12px;
  font-weight: 900;
}

.rp-crm-kanban-list {
  display: grid;
  grid-gap: 10px;
  gap: 10px;
}

.rp-crm-kanban-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.10);
}

.rp-crm-kanban-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.rp-crm-kanban-card strong {
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.rp-crm-kanban-card p {
  margin: 6px 0 0;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.6;
}

.rp-crm-kanban-card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: #fbbf24;
  font-size: 11px;
  font-weight: 900;
}

.rp-crm-kanban-card-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.rp-crm-kanban-card-actions button {
  min-height: 25px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.rp-crm-kanban-card-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.rp-crm-note-grid {
  display: grid;
  grid-gap: 10px;
  gap: 10px;
}

.rp-crm-note {
  padding: 14px;
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.10);
}

.rp-crm-note > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.rp-crm-note button {
  border: none;
  background: transparent;
  color: #f87171;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.rp-crm-note strong {
  display: block;
  margin-top: 10px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 950;
}

.rp-crm-note p {
  color: #94a3b8;
  line-height: 1.8;
  font-size: 12px;
}

.rp-crm-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: #64748b;
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.45);
  border: 1px dashed rgba(148, 163, 184, 0.18);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 1500px) {
  .rp-crm-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .rp-crm-hero,
  .rp-crm-grid.two,
  .rp-crm-grid.two.compact {
    grid-template-columns: 1fr;
  }

  .rp-crm-kanban {
    grid-template-columns: repeat(6, 280px);
  }
}

@media (max-width: 760px) {
  .rp-crm-kpi-grid,
  .rp-crm-form {
    grid-template-columns: 1fr;
  }

  .rp-crm-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ========== Royal Palace Auth & Login - Premium UI ========== */
.rp-auth-loading-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 78% 18%, rgba(245, 158, 11, 0.20), transparent 30%),
    radial-gradient(circle at 18% 82%, rgba(59, 130, 246, 0.12), transparent 28%),
    linear-gradient(135deg, #050810 0%, #0a1024 50%, #050810 100%);
  overflow: hidden;
}

.rp-auth-loading-bg-grid {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(245, 158, 11, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.rp-auth-loading-card {
  position: relative;
  z-index: 2;
  width: min(92vw, 440px);
  padding: 40px 30px;
  border-radius: 28px;
  background: rgba(12, 18, 36, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  -webkit-backdrop-filter: blur(20px);
          backdrop-filter: blur(20px);
}

.rp-auth-loading-mark {
  position: relative;
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 16px 40px rgba(245, 158, 11, 0.35);
}

.rp-auth-loading-pulse {
  position: absolute;
  inset: -6px;
  border: 2px solid rgba(245, 158, 11, 0.5);
  border-radius: 24px;
  animation: rpAuthPulseRing 2s ease-out infinite;
}

@keyframes rpAuthPulseRing {
  0% { opacity: 1; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.4); }
}

.rp-auth-loading-eyebrow {
  margin-bottom: 8px;
  color: #fbbf24;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rp-auth-loading-title {
  margin: 0;
  color: #f8fafc;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.4;
}

.rp-auth-loading-sub {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
}

.rp-auth-loading-spinner {
  width: 38px;
  height: 38px;
  margin: 22px auto 0;
  border-radius: 50%;
  border: 3px solid rgba(245, 158, 11, 0.18);
  border-top-color: #f59e0b;
  animation: rpAuthSpin 0.8s linear infinite;
}

@keyframes rpAuthSpin {
  to { transform: rotate(360deg); }
}

/* ========== LOGIN PAGE - Royal Glassmorphism ========== */
.rp-login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 0% 0%, rgba(245, 158, 11, 0.15), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.10), transparent 40%),
    linear-gradient(135deg, #050810 0%, #0a1024 50%, #060916 100%);
  overflow: hidden;
}

.rp-login-bg-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.rp-login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: rpOrbFloat 20s ease-in-out infinite;
}

.rp-login-orb-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -100px;
  background: radial-gradient(circle, #f59e0b, transparent);
}

.rp-login-orb-2 {
  width: 500px;
  height: 500px;
  bottom: -150px;
  left: -100px;
  background: radial-gradient(circle, #d97706, transparent);
  animation-delay: -7s;
}

.rp-login-orb-3 {
  width: 300px;
  height: 300px;
  top: 50%;
  left: 50%;
  background: radial-gradient(circle, #3b82f6, transparent);
  animation-delay: -14s;
  opacity: 0.2;
}

@keyframes rpOrbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.rp-login-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 158, 11, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
          mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
}

.rp-login-container {
  position: relative;
  z-index: 2;
  width: min(96vw, 1100px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 40px;
  gap: 40px;
  align-items: stretch;
  padding: 14px;
  border-radius: 30px;
  background: rgba(12, 18, 36, 0.5);
  border: 1px solid rgba(245, 158, 11, 0.18);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(24px);
          backdrop-filter: blur(24px);
}

/* Brand Side */
.rp-login-brand-side {
  position: relative;
  padding: 40px 30px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 40%),
    linear-gradient(135deg, rgba(7, 11, 20, 0.95), rgba(12, 18, 36, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.12);
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
}

.rp-login-brand-logo {
  display: flex;
  justify-content: center;
}

.rp-login-brand-mark {
  position: relative;
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  font-size: 30px;
  font-weight: 950;
  letter-spacing: -1px;
  box-shadow: 0 20px 50px rgba(245, 158, 11, 0.35);
}

.rp-login-brand-pulse {
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: 30px;
  animation: rpAuthPulseRing 2s ease-out infinite;
}

.rp-login-brand-title {
  margin: 0;
  text-align: center;
  color: #fff;
  font-size: 32px;
  font-weight: 950;
  letter-spacing: -1px;
}

.rp-login-brand-subtitle {
  margin: -10px 0 0;
  text-align: center;
  color: #fbbf24;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.rp-login-brand-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
  margin-bottom: auto;
}

.rp-login-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}

.rp-login-feature:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  transform: translateX(-4px);
}

.rp-login-feature-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.12);
  font-size: 20px;
  flex-shrink: 0;
}

.rp-login-feature strong {
  display: block;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 2px;
}

.rp-login-feature span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

.rp-login-brand-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}

/* Form Side */
.rp-login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rp-login-form-card {
  width: 100%;
  padding: 30px;
}

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

.rp-login-eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rp-login-form-head h2 {
  margin: 0;
  color: #fff;
  font-size: 32px;
  font-weight: 950;
  letter-spacing: -0.5px;
}

.rp-login-form-head p {
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
}

.rp-login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rp-login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rp-login-field label {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
}

.rp-login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.rp-login-input-icon {
  position: absolute;
  right: 14px;
  font-size: 16px;
  pointer-events: none;
  opacity: 0.7;
}

.rp-login-input-wrap input {
  width: 100%;
  min-height: 50px;
  padding: 0 44px 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(7, 11, 20, 0.6);
  color: #f8fafc;
  font-size: 14px;
  font-weight: 700;
  outline: none;
  transition: all 0.2s ease;
}

.rp-login-input-wrap input::placeholder {
  color: rgba(148, 163, 184, 0.4);
  font-weight: 500;
}

.rp-login-input-wrap input:focus {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(7, 11, 20, 0.85);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.10);
}

.rp-login-toggle-pwd {
  position: absolute;
  left: 8px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.rp-login-toggle-pwd:hover {
  background: rgba(255, 255, 255, 0.06);
}

.rp-login-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 700;
  animation: rpErrorShake 0.4s ease-in-out;
}

.rp-login-error span {
  font-size: 18px;
  flex-shrink: 0;
}

.rp-login-error p {
  margin: 0;
  line-height: 1.6;
}

@keyframes rpErrorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.rp-login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  margin-top: 8px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #050810;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(245, 158, 11, 0.30);
  transition: all 0.25s ease;
}

.rp-login-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(245, 158, 11, 0.40);
}

.rp-login-submit:active:not(:disabled) {
  transform: translateY(0);
}

.rp-login-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.rp-login-spinner-mini {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(5, 8, 16, 0.2);
  border-top-color: #050810;
  animation: rpAuthSpin 0.7s linear infinite;
}

.rp-login-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.rp-login-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rp-login-meta-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: rpDotPulseLogin 2s ease-in-out infinite;
}

@keyframes rpDotPulseLogin {
  50% { opacity: 0.4; }
}

@media (max-width: 920px) {
  .rp-login-container {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .rp-login-brand-side {
    padding: 24px;
  }

  .rp-login-brand-features {
    display: none;
  }
}

/* ========== Trading Dashboard - Glass Grid UI ========== */

.td-shell {
  display: flex;
  min-height: 100vh;
  background: #020610;
  color: #f8fafc;
  direction: rtl;
}

.td-main {
  flex: 1 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 20px 24px;
  overflow-x: hidden;
}

/* Ticker */
.td-ticker-wrap {
  width: 100%;
  overflow: hidden;
  background: rgba(4, 9, 20, 0.95);
  border-bottom: 1px solid rgba(245, 158, 11, 0.12);
  padding: 0;
  height: 36px;
  display: flex;
  align-items: center;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
}

.td-ticker-track {
  display: flex;
  gap: 0;
  animation: td-ticker-scroll 45s linear infinite;
  white-space: nowrap;
}

@keyframes td-ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.td-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 800;
}

.td-ticker-label {
  color: #475569;
}

.td-ticker-value {
  color: #f8fafc;
  font-family: monospace;
}

.td-ticker-value.up { color: #22c55e; }
.td-ticker-value.down { color: #ef4444; }
.td-ticker-value.flat { color: #f8fafc; }

.td-ticker-arrow {
  font-size: 9px;
}

.td-ticker-arrow.up { color: #22c55e; }
.td-ticker-arrow.down { color: #ef4444; }

/* Command Bar */
.td-command-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  grid-gap: 16px;
  gap: 16px;
  padding: 12px 16px;
  margin-top: 14px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(12, 20, 44, 0.92), rgba(6, 10, 24, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.td-command-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.td-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.28);
}

.td-brand-name {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 900;
}

.td-brand-sub {
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.td-command-center {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.td-period-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
}

.td-period-btn:hover {
  border-color: rgba(245, 158, 11, 0.28);
  color: #fbbf24;
}

.td-period-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(245, 158, 11, 0.08));
  border-color: rgba(245, 158, 11, 0.40);
  color: #fbbf24;
}

.td-command-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.td-server-time {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(7, 11, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 800;
  font-family: monospace;
  color: #22c55e;
  letter-spacing: 0.04em;
}

.td-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
  animation: rpDotPulse 1.8s ease-in-out infinite;
}

.td-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(7, 11, 20, 0.72);
  color: #475569;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.18s ease;
}

.td-action-btn svg {
  width: 15px;
  height: 15px;
}

.td-action-btn:hover {
  border-color: rgba(245, 158, 11, 0.28);
  color: #fbbf24;
}

.td-action-btn.spinning svg {
  animation: rpSpin 0.8s linear infinite;
}

/* Hero */
.td-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background:
    radial-gradient(circle at 8% 12%, rgba(245, 158, 11, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(10, 16, 36, 0.98), rgba(4, 8, 20, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.16);
}

.td-hero-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(245, 158, 11, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

.td-hero-content {
  position: relative;
  z-index: 1;
}

.td-hero-kicker {
  color: rgba(245, 158, 11, 0.80);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.td-hero-title {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 950;
  letter-spacing: -0.5px;
}

.td-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.td-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

.td-pill.live {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.18);
}

.td-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: rpDotPulse 1.8s ease-in-out infinite;
}

.td-pill.warn {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.18);
}

.td-hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(4, 8, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 16px 20px;
}

.td-hero-stat {}

.td-hero-stat-label {
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.td-hero-stat-value {
  font-size: 18px;
  font-weight: 950;
  font-family: monospace;
  letter-spacing: -0.5px;
}

.td-hero-stat-value.gold { color: #fbbf24; }
.td-hero-stat-value.green { color: #22c55e; }
.td-hero-stat-value.red { color: #ef4444; }
.td-hero-stat-value.cyan { color: #06b6d4; }

.td-hero-stat-sep {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
}

/* KPI Grid */
.td-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.td-kpi {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: 16px;
  background: rgba(8, 14, 32, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.22s ease, transform 0.22s ease;
  text-decoration: none;
  cursor: pointer;
}

.td-kpi:hover {
  border-color: rgba(245, 158, 11, 0.22);
  transform: translateY(-2px);
}

.td-kpi-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 22px 22px;
  border-radius: inherit;
}

.td-kpi-glow {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.7;
  pointer-events: none;
}

.td-kpi-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.td-kpi-label {
  color: #475569;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.td-kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 950;
}

.td-kpi-badge.up { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.td-kpi-badge.down { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.td-kpi-value {
  position: relative;
  font-size: clamp(17px, 1.6vw, 22px);
  font-weight: 950;
  font-family: monospace;
  letter-spacing: -0.8px;
  margin-bottom: 3px;
  line-height: 1.1;
}

.td-kpi-note {
  color: #334155;
  font-size: 9px;
  font-weight: 800;
}

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

.td-kpi-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0.7;
  animation: rpDotPulse 2.5s ease-in-out infinite;
}

/* Tabs */
.td-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 4px;
}

.td-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.18s ease;
}

.td-tab:hover { color: #94a3b8; }

.td-tab.active {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}

.td-tab-badge {
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  padding: 0 4px;
}

/* Glass Panels */
.td-panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: 18px;
  background: rgba(6, 10, 24, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.td-panel:hover {
  border-color: rgba(255, 255, 255, 0.10);
}

.td-panel-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  border-radius: inherit;
}

.td-panel-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.td-panel-label {
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 950;
}

.td-panel-sub {
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  margin-top: 3px;
}

.td-panel-tag {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.06em;
}

/* Grid layouts */
.td-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-gap: 14px; gap: 14px; }
.td-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 14px; gap: 14px; }

/* Product Row */
.td-product-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-gap: 10px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(4, 8, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 6px;
}

.td-product-rank {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 10px;
  font-weight: 950;
}

.td-product-name {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-product-qty {
  color: #334155;
  font-size: 10px;
  margin-top: 2px;
}

.td-product-rev {
  color: #22c55e;
  font-size: 11px;
  font-weight: 950;
  font-family: monospace;
  text-align: left;
}

.td-product-rev span {
  font-size: 9px;
  color: #334155;
  margin-right: 2px;
}

/* Insights */
.td-insight {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 7px;
  border: 1px solid transparent;
}

.td-insight.success { background: rgba(34, 197, 94, 0.05); border-color: rgba(34, 197, 94, 0.12); }
.td-insight.warning { background: rgba(245, 158, 11, 0.05); border-color: rgba(245, 158, 11, 0.12); }
.td-insight.danger { background: rgba(239, 68, 68, 0.05); border-color: rgba(239, 68, 68, 0.12); }
.td-insight.info { background: rgba(59, 130, 246, 0.05); border-color: rgba(59, 130, 246, 0.12); }

.td-insight-icon {
  font-size: 14px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  color: #f8fafc;
  font-family: monospace;
}

.td-insight-title { color: #f8fafc; font-size: 12px; font-weight: 900; }
.td-insight-desc { color: #475569; font-size: 11px; font-weight: 700; margin-top: 2px; }

/* Feed */
.td-feed-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.td-feed-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.td-feed-dot.danger { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }
.td-feed-dot.green { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12); }

.td-feed-title { color: #f8fafc; font-size: 11px; font-weight: 800; }
.td-feed-meta { color: #334155; font-size: 10px; margin-top: 2px; }

/* Finance */
.td-fin-row {
  padding: 10px;
  border-radius: 10px;
  background: rgba(4, 8, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  grid-gap: 5px;
  gap: 5px;
}

.td-fin-label { color: #475569; font-size: 10px; font-weight: 800; }
.td-fin-value { font-size: 18px; font-weight: 950; font-family: monospace; }
.td-fin-bar { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.td-fin-bar div { height: 100%; border-radius: inherit; }

/* Factory */
.td-factory-grid { display: grid; grid-gap: 10px; gap: 10px; }

.td-factory-card {
  padding: 12px;
  border-radius: 12px;
  background: rgba(4, 8, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.td-factory-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.td-factory-name { color: #f8fafc; font-size: 12px; font-weight: 900; }

.td-factory-status {
  font-size: 9px;
  font-weight: 950;
  padding: 3px 8px;
  border-radius: 999px;
}

.td-factory-status.active { color: #22c55e; background: rgba(34, 197, 94, 0.10); }
.td-factory-status.inactive { color: #ef4444; background: rgba(239, 68, 68, 0.10); }

.td-factory-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 8px;
  gap: 8px;
}

.td-factory-stats div { text-align: center; }
.td-factory-stats span { color: #334155; font-size: 9px; font-weight: 700; display: block; }
.td-factory-stats b { color: #f8fafc; font-size: 16px; font-weight: 950; }

/* Stats Grid */
.td-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.td-stat-box {
  padding: 12px;
  border-radius: 12px;
  background: rgba(4, 8, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.td-stat-label { color: #334155; font-size: 10px; font-weight: 800; margin-bottom: 5px; }
.td-stat-value { font-size: 20px; font-weight: 950; font-family: monospace; }

/* Quick Grid */
.td-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  grid-gap: 8px;
  gap: 8px;
}

.td-quick-btn {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(4, 8, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #475569;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  transition: all 0.18s ease;
}

.td-quick-btn:hover {
  border-color: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.05);
}

/* Status Bar */
.td-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(4, 8, 20, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  gap: 8px;
}

.td-status-left {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.td-status-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  color: #334155;
}

.td-status-item.gray { color: #1e293b; }

.td-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.td-status-dot.green { background: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18); }

.td-status-right {
  color: #1e293b;
  font-size: 10px;
  font-weight: 800;
  font-family: monospace;
}

/* Empty */
.td-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #1e293b;
  font-size: 12px;
  font-weight: 800;
  grid-gap: 8px;
  gap: 8px;
}

/* Loading */
.td-loading-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #020610;
  padding: 24px;
}

.td-loading-card {
  text-align: center;
  max-width: 380px;
}

.td-loading-logo {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 22px;
  font-weight: 950;
  box-shadow: 0 20px 40px rgba(245, 158, 11, 0.24);
}

.td-loading-eyebrow {
  color: rgba(245, 158, 11, 0.80);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.td-loading-title {
  color: #f8fafc;
  font-size: 18px;
  font-weight: 950;
  margin-bottom: 18px;
}

.td-loading-bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.td-loading-progress {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: inherit;
  animation: td-progress 1.6s ease-in-out infinite;
}

@keyframes td-progress {
  0% { width: 0%; margin-left: 0; }
  50% { width: 70%; }
  100% { width: 0%; margin-left: 100%; }
}

/* Responsive */
@media (max-width: 1400px) {
  .td-kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1100px) {
  .td-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .td-grid-2, .td-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .td-main { padding: 0 12px 20px; }
  .td-kpi-grid { grid-template-columns: 1fr; }
  .td-command-bar { grid-template-columns: 1fr; }
  .td-hero { flex-direction: column; }
}

/* ========== Dashboard Trading - Charts Glass Grid ONLY ========== */

.td-kpi-mesh,
.td-panel-mesh,
.td-hero-mesh {
  display: none !important;
}

.td-kpi {
  background: rgba(10, 16, 34, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 18px !important;
}

.td-kpi:hover {
  border-color: rgba(245, 158, 11, 0.18) !important;
}

.td-panel {
  background: rgba(8, 13, 28, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.td-hero {
  background:
    radial-gradient(circle at 8% 12%, rgba(245, 158, 11, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(10, 16, 36, 0.98), rgba(4, 8, 20, 0.98)) !important;
}

.td-chart-glass-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(4, 8, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.td-chart-glass-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 38px 38px;
}

.td-chart-glass-wrap .recharts-wrapper,
.td-chart-glass-wrap > div {
  position: relative;
  z-index: 2;
}

.td-kpi-spark {
  height: 36px;
  width: 100%;
}

.td-kpi-spark .recharts-surface {
  overflow: visible;
}

.recharts-cartesian-axis-tick text {
  fill: #334155 !important;
  font-size: 10px !important;
}

.recharts-cartesian-grid-horizontal line,
.recharts-cartesian-grid-vertical line {
  stroke: rgba(255, 255, 255, 0.04) !important;
  stroke-dasharray: none !important;
}

.recharts-curve.recharts-area-curve {
  stroke-width: 1.5px !important;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.25));
}

.recharts-area-area {
  opacity: 0.18 !important;
}

.recharts-line-curve {
  stroke-width: 1.5px !important;
  filter: drop-shadow(0 0 5px currentColor);
}

.recharts-bar-rectangle path {
  opacity: 0.72 !important;
  rx: 4 !important;
}

.recharts-tooltip-wrapper {
  z-index: 999 !important;
}

.recharts-legend-wrapper {
  font-size: 10px !important;
}

/* ========== Trading Dashboard - Glass Grid UI ========== */

.td-shell {
  display: flex;
  min-height: 100vh;
  background: #020610;
  color: #f8fafc;
  direction: rtl;
}

.td-main {
  flex: 1 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 20px 24px;
  overflow-x: hidden;
}

/* Ticker */
.td-ticker-wrap {
  width: 100%;
  overflow: hidden;
  background: rgba(4, 9, 20, 0.95);
  border-bottom: 1px solid rgba(245, 158, 11, 0.12);
  padding: 0;
  height: 36px;
  display: flex;
  align-items: center;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
}

.td-ticker-track {
  display: flex;
  gap: 0;
  animation: td-ticker-scroll 45s linear infinite;
  white-space: nowrap;
}

@keyframes td-ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.td-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 800;
}

.td-ticker-label {
  color: #475569;
}

.td-ticker-value {
  color: #f8fafc;
  font-family: monospace;
}

.td-ticker-value.up { color: #22c55e; }
.td-ticker-value.down { color: #ef4444; }
.td-ticker-value.flat { color: #f8fafc; }

.td-ticker-arrow {
  font-size: 9px;
}

.td-ticker-arrow.up { color: #22c55e; }
.td-ticker-arrow.down { color: #ef4444; }

/* Command Bar */
.td-command-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  grid-gap: 16px;
  gap: 16px;
  padding: 12px 16px;
  margin-top: 14px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(12, 20, 44, 0.92), rgba(6, 10, 24, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.td-command-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.td-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.28);
}

.td-brand-name {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 900;
}

.td-brand-sub {
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.td-command-center {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.td-period-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
}

.td-period-btn:hover {
  border-color: rgba(245, 158, 11, 0.28);
  color: #fbbf24;
}

.td-period-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(245, 158, 11, 0.08));
  border-color: rgba(245, 158, 11, 0.40);
  color: #fbbf24;
}

.td-command-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.td-server-time {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(7, 11, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 800;
  font-family: monospace;
  color: #22c55e;
  letter-spacing: 0.04em;
}

.td-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
  animation: rpDotPulse 1.8s ease-in-out infinite;
}

.td-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(7, 11, 20, 0.72);
  color: #475569;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.18s ease;
}

.td-action-btn svg {
  width: 15px;
  height: 15px;
}

.td-action-btn:hover {
  border-color: rgba(245, 158, 11, 0.28);
  color: #fbbf24;
}

.td-action-btn.spinning svg {
  animation: rpSpin 0.8s linear infinite;
}

/* Hero */
.td-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background:
    radial-gradient(circle at 8% 12%, rgba(245, 158, 11, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(10, 16, 36, 0.98), rgba(4, 8, 20, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.16);
}

.td-hero-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(245, 158, 11, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

.td-hero-content {
  position: relative;
  z-index: 1;
}

.td-hero-kicker {
  color: rgba(245, 158, 11, 0.80);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.td-hero-title {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 950;
  letter-spacing: -0.5px;
}

.td-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.td-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

.td-pill.live {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.18);
}

.td-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: rpDotPulse 1.8s ease-in-out infinite;
}

.td-pill.warn {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.18);
}

.td-hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(4, 8, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 16px 20px;
}

.td-hero-stat {}

.td-hero-stat-label {
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.td-hero-stat-value {
  font-size: 18px;
  font-weight: 950;
  font-family: monospace;
  letter-spacing: -0.5px;
}

.td-hero-stat-value.gold { color: #fbbf24; }
.td-hero-stat-value.green { color: #22c55e; }
.td-hero-stat-value.red { color: #ef4444; }
.td-hero-stat-value.cyan { color: #06b6d4; }

.td-hero-stat-sep {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
}

/* KPI Grid */
.td-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.td-kpi {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: 16px;
  background: rgba(8, 14, 32, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.22s ease, transform 0.22s ease;
  text-decoration: none;
  cursor: pointer;
}

.td-kpi:hover {
  border-color: rgba(245, 158, 11, 0.22);
  transform: translateY(-2px);
}

.td-kpi-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 22px 22px;
  border-radius: inherit;
}

.td-kpi-glow {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.7;
  pointer-events: none;
}

.td-kpi-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.td-kpi-label {
  color: #475569;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.td-kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 950;
}

.td-kpi-badge.up { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.td-kpi-badge.down { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.td-kpi-value {
  position: relative;
  font-size: clamp(17px, 1.6vw, 22px);
  font-weight: 950;
  font-family: monospace;
  letter-spacing: -0.8px;
  margin-bottom: 3px;
  line-height: 1.1;
}

.td-kpi-note {
  color: #334155;
  font-size: 9px;
  font-weight: 800;
}

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

.td-kpi-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0.7;
  animation: rpDotPulse 2.5s ease-in-out infinite;
}

/* Tabs */
.td-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 4px;
}

.td-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.18s ease;
}

.td-tab:hover { color: #94a3b8; }

.td-tab.active {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}

.td-tab-badge {
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  padding: 0 4px;
}

/* Glass Panels */
.td-panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: 18px;
  background: rgba(6, 10, 24, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.td-panel:hover {
  border-color: rgba(255, 255, 255, 0.10);
}

.td-panel-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  border-radius: inherit;
}

.td-panel-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.td-panel-label {
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 950;
}

.td-panel-sub {
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  margin-top: 3px;
}

.td-panel-tag {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.06em;
}

/* Grid layouts */
.td-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-gap: 14px; gap: 14px; }
.td-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 14px; gap: 14px; }

/* Product Row */
.td-product-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-gap: 10px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(4, 8, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 6px;
}

.td-product-rank {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 10px;
  font-weight: 950;
}

.td-product-name {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-product-qty {
  color: #334155;
  font-size: 10px;
  margin-top: 2px;
}

.td-product-rev {
  color: #22c55e;
  font-size: 11px;
  font-weight: 950;
  font-family: monospace;
  text-align: left;
}

.td-product-rev span {
  font-size: 9px;
  color: #334155;
  margin-right: 2px;
}

/* Insights */
.td-insight {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 7px;
  border: 1px solid transparent;
}

.td-insight.success { background: rgba(34, 197, 94, 0.05); border-color: rgba(34, 197, 94, 0.12); }
.td-insight.warning { background: rgba(245, 158, 11, 0.05); border-color: rgba(245, 158, 11, 0.12); }
.td-insight.danger { background: rgba(239, 68, 68, 0.05); border-color: rgba(239, 68, 68, 0.12); }
.td-insight.info { background: rgba(59, 130, 246, 0.05); border-color: rgba(59, 130, 246, 0.12); }

.td-insight-icon {
  font-size: 14px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  color: #f8fafc;
  font-family: monospace;
}

.td-insight-title { color: #f8fafc; font-size: 12px; font-weight: 900; }
.td-insight-desc { color: #475569; font-size: 11px; font-weight: 700; margin-top: 2px; }

/* Feed */
.td-feed-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.td-feed-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.td-feed-dot.danger { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }
.td-feed-dot.green { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12); }

.td-feed-title { color: #f8fafc; font-size: 11px; font-weight: 800; }
.td-feed-meta { color: #334155; font-size: 10px; margin-top: 2px; }

/* Finance */
.td-fin-row {
  padding: 10px;
  border-radius: 10px;
  background: rgba(4, 8, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  grid-gap: 5px;
  gap: 5px;
}

.td-fin-label { color: #475569; font-size: 10px; font-weight: 800; }
.td-fin-value { font-size: 18px; font-weight: 950; font-family: monospace; }
.td-fin-bar { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.td-fin-bar div { height: 100%; border-radius: inherit; }

/* Factory */
.td-factory-grid { display: grid; grid-gap: 10px; gap: 10px; }

.td-factory-card {
  padding: 12px;
  border-radius: 12px;
  background: rgba(4, 8, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.td-factory-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.td-factory-name { color: #f8fafc; font-size: 12px; font-weight: 900; }

.td-factory-status {
  font-size: 9px;
  font-weight: 950;
  padding: 3px 8px;
  border-radius: 999px;
}

.td-factory-status.active { color: #22c55e; background: rgba(34, 197, 94, 0.10); }
.td-factory-status.inactive { color: #ef4444; background: rgba(239, 68, 68, 0.10); }

.td-factory-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 8px;
  gap: 8px;
}

.td-factory-stats div { text-align: center; }
.td-factory-stats span { color: #334155; font-size: 9px; font-weight: 700; display: block; }
.td-factory-stats b { color: #f8fafc; font-size: 16px; font-weight: 950; }

/* Stats Grid */
.td-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.td-stat-box {
  padding: 12px;
  border-radius: 12px;
  background: rgba(4, 8, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.td-stat-label { color: #334155; font-size: 10px; font-weight: 800; margin-bottom: 5px; }
.td-stat-value { font-size: 20px; font-weight: 950; font-family: monospace; }

/* Quick Grid */
.td-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  grid-gap: 8px;
  gap: 8px;
}

.td-quick-btn {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(4, 8, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #475569;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  transition: all 0.18s ease;
}

.td-quick-btn:hover {
  border-color: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.05);
}

/* Status Bar */
.td-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(4, 8, 20, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  gap: 8px;
}

.td-status-left {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.td-status-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  color: #334155;
}

.td-status-item.gray { color: #1e293b; }

.td-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.td-status-dot.green { background: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18); }

.td-status-right {
  color: #1e293b;
  font-size: 10px;
  font-weight: 800;
  font-family: monospace;
}

/* Empty */
.td-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #1e293b;
  font-size: 12px;
  font-weight: 800;
  grid-gap: 8px;
  gap: 8px;
}

/* Loading */
.td-loading-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #020610;
  padding: 24px;
}

.td-loading-card {
  text-align: center;
  max-width: 380px;
}

.td-loading-logo {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #050810;
  font-size: 22px;
  font-weight: 950;
  box-shadow: 0 20px 40px rgba(245, 158, 11, 0.24);
}

.td-loading-eyebrow {
  color: rgba(245, 158, 11, 0.80);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.td-loading-title {
  color: #f8fafc;
  font-size: 18px;
  font-weight: 950;
  margin-bottom: 18px;
}

.td-loading-bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.td-loading-progress {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: inherit;
  animation: td-progress 1.6s ease-in-out infinite;
}

@keyframes td-progress {
  0% { width: 0%; margin-left: 0; }
  50% { width: 70%; }
  100% { width: 0%; margin-left: 100%; }
}

/* Responsive */
@media (max-width: 1400px) {
  .td-kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1100px) {
  .td-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .td-grid-2, .td-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .td-main { padding: 0 12px 20px; }
  .td-kpi-grid { grid-template-columns: 1fr; }
  .td-command-bar { grid-template-columns: 1fr; }
  .td-hero { flex-direction: column; }
}

/* ========== ChartGlass Component ========== */
.td-chart-glass {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(4, 8, 18, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.td-chart-glass-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 36px 36px;
}

.td-chart-glass-inner {
  position: relative;
  z-index: 2;
}

.td-kpi-mesh,
.td-panel-mesh,
.td-hero-mesh {
  display: none !important;
}

.td-kpi {
  background: rgba(10, 16, 34, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.td-kpi:hover {
  border-color: rgba(245, 158, 11, 0.16) !important;
  transform: translateY(-2px);
}

.td-panel {
  background: rgba(8, 13, 28, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.recharts-cartesian-axis-tick text {
  fill: #1e293b !important;
  font-size: 10px !important;
}

.recharts-cartesian-grid-horizontal line,
.recharts-cartesian-grid-vertical line {
  stroke: rgba(255, 255, 255, 0.035) !important;
}

.recharts-area-curve {
  stroke-width: 1.5px !important;
}

.recharts-area-area {
  opacity: 0.20 !important;
}

.recharts-line-curve {
  stroke-width: 1.5px !important;
}

.recharts-bar-rectangle path {
  opacity: 0.70 !important;
}

/* سكرول منفصل آمن (لا يكسر التنسيق) */
.erp-shell, .rp-dash-shell, .td-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.erp-main, .rp-dash-main, .td-main {
  flex: 1 1 auto;
  overflow-y: auto;
  height: 100%;
}
.rp-sidebar {
  flex-shrink: 0;
  overflow-y: auto;
  height: 100vh;
}

