:root{
  --rtp-bg:#0b0c0f;
  --rtp-sidebar:#191c24;
  --rtp-card:#191c24;
  --rtp-card-hover:#20242d;
  --rtp-input:#101217;
  --rtp-border:#2a2e37;
  --rtp-border-light:#343945;
  --rtp-primary:#eb1616;
  --rtp-primary-hover:#c91212;
  --rtp-primary-soft:rgba(235,22,22,.12);
  --rtp-text:#f3f4f6;
  --rtp-text-secondary:#9ca3af;
  --rtp-muted:#6b7280;
  --rtp-success:#22c55e;
  --rtp-warning:#f59e0b;
  --rtp-danger:#ef4444;
  --rtp-info:#0ea5e9;
  --rtp-sidebar-width:250px;
  --rtp-topbar-height:64px;
}

*{box-sizing:border-box}

html,body{
  min-height:100%;
  background:var(--rtp-bg);
}

body{
  margin:0;
  background:var(--rtp-bg)!important;
  color:var(--rtp-text)!important;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:14px;
}

a{color:inherit}

.rtp-app{
  min-height:100vh;
}

.rtp-sidebar{
  position:fixed;
  inset:0 auto 0 0;
  width:var(--rtp-sidebar-width);
  background:var(--rtp-sidebar);
  border-right:1px solid var(--rtp-border);
  z-index:1040;
  display:flex;
  flex-direction:column;
  transition:transform .2s ease;
}

.rtp-brand{
  height:var(--rtp-topbar-height);
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 20px;
  border-bottom:1px solid var(--rtp-border);
  text-decoration:none;
}

.rtp-brand-mark{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:6px;
  background:var(--rtp-primary);
  color:#fff;
  font-weight:800;
  font-size:14px;
  letter-spacing:.04em;
}

.rtp-brand-text strong{
  display:block;
  color:#fff;
  font-size:15px;
  line-height:1.1;
}

.rtp-brand-text small{
  color:var(--rtp-muted);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.12em;
}

.rtp-nav{
  flex:1;
  overflow-y:auto;
  padding:16px 12px;
}

.rtp-nav-section{
  padding:14px 12px 6px;
  color:#5f6673;
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.14em;
  font-weight:700;
}

.rtp-nav-link{
  min-height:44px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  margin:2px 0;
  border-left:3px solid transparent;
  border-radius:4px;
  color:var(--rtp-text-secondary);
  text-decoration:none;
  transition:.15s ease;
}

.rtp-nav-link i{
  width:20px;
  text-align:center;
  font-size:17px;
}

.rtp-nav-link:hover{
  background:var(--rtp-card-hover);
  color:#fff;
}

.rtp-nav-link.active{
  color:var(--rtp-primary);
  background:var(--rtp-primary-soft);
  border-left-color:var(--rtp-primary);
}

.rtp-sidebar-footer{
  border-top:1px solid var(--rtp-border);
  padding:12px;
}

.rtp-main{
  margin-left:var(--rtp-sidebar-width);
  min-height:100vh;
}

.rtp-topbar{
  height:var(--rtp-topbar-height);
  position:sticky;
  top:0;
  z-index:1020;
  background:rgba(25,28,36,.96);
  border-bottom:1px solid var(--rtp-border);
  backdrop-filter:blur(8px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 22px;
}

.rtp-topbar-left,
.rtp-topbar-right{
  display:flex;
  align-items:center;
  gap:12px;
}

.rtp-menu-toggle{
  width:38px;
  height:38px;
  display:none;
  border:1px solid var(--rtp-border-light);
  background:var(--rtp-card-hover);
  color:#fff;
  border-radius:5px;
}

.rtp-system-pill{
  display:flex;
  align-items:center;
  gap:7px;
  color:var(--rtp-text-secondary);
  font-size:12px;
}

.rtp-system-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--rtp-success);
  box-shadow:0 0 0 4px rgba(34,197,94,.08);
}

.rtp-content{
  padding:24px;
  max-width:1800px;
  margin:0 auto;
}

.rtp-overlay{
  display:none;
}

.page-title,
.rtp-page-title{
  color:#fff;
  font-size:26px;
  font-weight:700;
  letter-spacing:-.02em;
}

.page-subtitle,
.rtp-page-subtitle{
  color:var(--rtp-text-secondary);
  font-size:14px;
}

.card,
.panel,
.list-group-item,
.modal-content,
.dropdown-menu{
  background:var(--rtp-card)!important;
  color:var(--rtp-text)!important;
  border:1px solid var(--rtp-border)!important;
  border-radius:6px!important;
  box-shadow:none!important;
}

.card-header,
.card-footer{
  background:transparent!important;
  border-color:var(--rtp-border)!important;
}

.card h1,.card h2,.card h3,.card h4,.card h5,.card h6,
.panel h1,.panel h2,.panel h3,.panel h4,.panel h5,.panel h6{
  color:#fff;
}

.text-muted{
  color:var(--rtp-text-secondary)!important;
}

.border,
.border-top,
.border-end,
.border-bottom,
.border-start{
  border-color:var(--rtp-border)!important;
}

.list-group-item{
  border-left:0!important;
  border-right:0!important;
}

.list-group-item-action:hover{
  background:var(--rtp-card-hover)!important;
  color:#fff!important;
}

.table{
  --bs-table-bg:transparent;
  --bs-table-color:var(--rtp-text);
  --bs-table-border-color:var(--rtp-border);
  --bs-table-striped-bg:rgba(255,255,255,.018);
  --bs-table-striped-color:var(--rtp-text);
  --bs-table-hover-bg:var(--rtp-card-hover);
  --bs-table-hover-color:#fff;
  color:var(--rtp-text)!important;
  margin-bottom:0;
}

.table thead th{
  color:var(--rtp-text-secondary)!important;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.055em;
  font-weight:700;
  white-space:nowrap;
  border-bottom-color:var(--rtp-border-light)!important;
}

.table tbody td{
  vertical-align:middle;
  border-color:var(--rtp-border)!important;
}

.table-responsive{
  border-radius:5px;
  -webkit-overflow-scrolling:touch;
}

.form-control,
.form-select,
.form-check-input,
.input-group-text{
  background-color:var(--rtp-input)!important;
  border-color:var(--rtp-border-light)!important;
  color:var(--rtp-text)!important;
  border-radius:5px!important;
}

.form-control::placeholder{
  color:#59606d;
}

.form-control:focus,
.form-select:focus{
  border-color:var(--rtp-primary)!important;
  box-shadow:0 0 0 3px rgba(235,22,22,.12)!important;
}

.form-select{
  color-scheme:dark;
}

.form-label{
  color:var(--rtp-text-secondary);
  font-size:12px;
  font-weight:600;
}

.btn{
  border-radius:5px!important;
  min-height:36px;
  font-weight:600;
}

.btn-primary{
  background:var(--rtp-primary)!important;
  border-color:var(--rtp-primary)!important;
}

.btn-primary:hover{
  background:var(--rtp-primary-hover)!important;
  border-color:var(--rtp-primary-hover)!important;
}

.btn-dark,
.btn-secondary{
  background:var(--rtp-card-hover)!important;
  border-color:var(--rtp-border-light)!important;
  color:#fff!important;
}

.btn-outline-primary{
  color:#ff4d4d!important;
  border-color:#7b2424!important;
}

.btn-outline-primary:hover{
  background:var(--rtp-primary)!important;
  border-color:var(--rtp-primary)!important;
  color:#fff!important;
}

.btn-outline-secondary,
.btn-outline-dark{
  color:#d1d5db!important;
  border-color:var(--rtp-border-light)!important;
}

.btn-outline-secondary:hover,
.btn-outline-dark:hover{
  background:var(--rtp-card-hover)!important;
  color:#fff!important;
}

.badge{
  border-radius:4px!important;
  padding:.38em .6em;
  font-size:10px;
  letter-spacing:.035em;
}

.alert{
  border-radius:5px!important;
  border-width:1px!important;
  background:var(--rtp-card)!important;
}

.alert-danger{
  color:#fecaca!important;
  border-color:rgba(239,68,68,.35)!important;
  background:rgba(239,68,68,.08)!important;
}

.alert-info{
  color:#bae6fd!important;
  border-color:rgba(14,165,233,.30)!important;
  background:rgba(14,165,233,.07)!important;
}

.alert-warning{
  color:#fde68a!important;
  border-color:rgba(245,158,11,.30)!important;
  background:rgba(245,158,11,.07)!important;
}

.rtp-dashboard-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  margin-bottom:22px;
}

.rtp-kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-bottom:18px;
}

.rtp-kpi{
  position:relative;
  overflow:hidden;
  min-height:132px;
  background:var(--rtp-card);
  border:1px solid var(--rtp-border);
  border-radius:6px;
  padding:18px;
}

.rtp-kpi::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:3px;
  background:var(--rtp-primary);
}

.rtp-kpi-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.rtp-kpi-label{
  color:var(--rtp-text-secondary);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:700;
}

.rtp-kpi-icon{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:5px;
  background:var(--rtp-primary-soft);
  color:var(--rtp-primary);
  font-size:17px;
}

.rtp-kpi-value{
  display:block;
  margin-top:15px;
  color:#fff;
  font-size:30px;
  line-height:1;
  font-weight:750;
}

.rtp-kpi-meta{
  display:block;
  margin-top:8px;
  color:var(--rtp-muted);
  font-size:11px;
}

.rtp-grid-main{
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(300px,1fr);
  gap:14px;
}

.rtp-panel{
  background:var(--rtp-card);
  border:1px solid var(--rtp-border);
  border-radius:6px;
}

.rtp-panel-header{
  min-height:54px;
  padding:14px 18px;
  border-bottom:1px solid var(--rtp-border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.rtp-panel-title{
  margin:0;
  color:#fff;
  font-size:15px;
  font-weight:700;
}

.rtp-panel-body{
  padding:18px;
}

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

.rtp-module-link{
  min-height:76px;
  display:flex;
  align-items:center;
  gap:14px;
  border:1px solid var(--rtp-border);
  background:#14171d;
  color:var(--rtp-text);
  text-decoration:none;
  padding:14px;
  border-radius:5px;
  transition:.15s ease;
}

.rtp-module-link:hover{
  transform:translateY(-1px);
  border-color:#493034;
  background:var(--rtp-card-hover);
  color:#fff;
}

.rtp-module-icon{
  width:38px;
  height:38px;
  flex:0 0 38px;
  display:grid;
  place-items:center;
  background:var(--rtp-primary-soft);
  color:var(--rtp-primary);
  border-radius:5px;
  font-size:18px;
}

.rtp-source-row{
  padding:11px 0;
  border-bottom:1px solid var(--rtp-border);
}

.rtp-source-row:last-child{
  border-bottom:0;
}

.rtp-source-name{
  color:#fff;
  font-weight:600;
}

.rtp-source-meta{
  display:flex;
  gap:8px;
  align-items:center;
  margin-top:5px;
  color:var(--rtp-muted);
  font-size:11px;
}

.rtp-mobile-only{display:none}

@media(max-width:1199px){
  .rtp-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .rtp-grid-main{
    grid-template-columns:1fr;
  }
}

@media(max-width:991px){
  .rtp-sidebar{
    transform:translateX(-100%);
    box-shadow:12px 0 30px rgba(0,0,0,.35);
  }

  body.rtp-nav-open .rtp-sidebar{
    transform:translateX(0);
  }

  .rtp-main{
    margin-left:0;
  }

  .rtp-menu-toggle{
    display:grid;
    place-items:center;
  }

  .rtp-overlay{
    position:fixed;
    inset:0;
    z-index:1030;
    background:rgba(0,0,0,.58);
  }

  body.rtp-nav-open .rtp-overlay{
    display:block;
  }
}

@media(max-width:767px){
  .rtp-content{
    padding:16px 12px 28px;
  }

  .rtp-topbar{
    padding:0 12px;
  }

  .rtp-system-pill span{
    display:none;
  }

  .rtp-dashboard-header{
    flex-direction:column;
  }

  .rtp-dashboard-header .btn{
    width:100%;
  }

  .rtp-kpi-grid{
    grid-template-columns:1fr;
    gap:10px;
  }

  .rtp-kpi{
    min-height:112px;
  }

  .rtp-kpi-value{
    font-size:27px;
  }

  .rtp-module-grid{
    grid-template-columns:1fr;
  }

  .container,
  .container-fluid{
    --bs-gutter-x:1rem;
  }

  h1{font-size:1.55rem}
  h2{font-size:1.4rem}
  h3{font-size:1.2rem}

  .card{
    border-radius:5px!important;
  }

  .table{
    font-size:12px!important;
  }

  .btn{
    min-height:38px;
  }

  .row.g-3{
    --bs-gutter-y:.75rem;
  }

  .rtp-mobile-only{
    display:block;
  }
}

@media(max-width:480px){
  .rtp-brand{
    padding-left:16px;
  }

  .rtp-sidebar{
    width:min(86vw,280px);
  }

  .rtp-content{
    padding-left:10px;
    padding-right:10px;
  }
}
