/* =========================================================
   ROYAL POWER SYSTEM ERP - PREMIUM THEME
   Blue / White / Dark Sidebar
   ========================================================= */

:root{
  --rps-primary:#1a56db;
  --rps-primary-dark:#123a99;
  --rps-primary-light:#e8f0fe;
  --rps-sidebar-bg:#0f1b2d;
  --rps-sidebar-bg-hover:#16263e;
  --rps-sidebar-active:#1a56db;
  --rps-text-muted:#8a94a6;
  --rps-success:#0ea45a;
  --rps-warning:#f2a90d;
  --rps-danger:#e0293f;
  --rps-radius:14px;
  --rps-shadow: 0 2px 10px rgba(20,30,60,.06);
  --rps-shadow-lg: 0 10px 30px rgba(20,30,60,.10);
}

*{box-sizing:border-box;}

body{
  background:#f3f5fb;
  font-family:'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  color:#1f2733;
  font-size:14.5px;
}

a{ text-decoration:none; }

/* ---------------- SIDEBAR ---------------- */
.rps-sidebar{
  position:fixed; top:0; left:0; bottom:0; width:260px; z-index:1030;
  background:linear-gradient(180deg,var(--rps-sidebar-bg) 0%, #0b1522 100%);
  overflow-y:auto; transition:transform .25s ease;
  scrollbar-width:thin;
}
.rps-sidebar::-webkit-scrollbar{width:6px;}
.rps-sidebar::-webkit-scrollbar-thumb{background:#233450;border-radius:10px;}

.rps-sidebar .brand{
  display:flex; align-items:center; gap:10px;
  padding:20px 20px; color:#fff; font-weight:700; font-size:18px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.rps-sidebar .brand .logo-icon{
  width:38px;height:38px;border-radius:10px;
  background:linear-gradient(135deg,var(--rps-primary),#5b8def);
  display:flex;align-items:center;justify-content:center;font-size:18px;
  box-shadow:0 4px 14px rgba(26,86,219,.5);
}
.rps-sidebar .brand small{display:block;font-weight:400;font-size:11px;color:var(--rps-text-muted);}

.rps-nav{ padding:14px 12px; }
.rps-nav .nav-section-title{
  text-transform:uppercase; font-size:11px; letter-spacing:.08em;
  color:#5b6b85; padding:14px 12px 6px;
}
.rps-nav .nav-link{
  color:#c3cbdb; padding:10px 14px; border-radius:10px; margin-bottom:3px;
  display:flex; align-items:center; gap:12px; font-size:14px; font-weight:500;
  transition:.15s ease;
}
.rps-nav .nav-link i{ font-size:17px; width:20px; text-align:center; color:#7c8bab; }
.rps-nav .nav-link:hover{ background:var(--rps-sidebar-bg-hover); color:#fff; }
.rps-nav .nav-link:hover i{ color:#fff; }
.rps-nav .nav-link.active{
  background:linear-gradient(135deg,var(--rps-primary),#2e6fe8); color:#fff;
  box-shadow:0 6px 16px rgba(26,86,219,.35);
}
.rps-nav .nav-link.active i{ color:#fff; }
.rps-nav .nav-link .badge-count{margin-left:auto;font-size:10px;}

/* ---------------- TOPBAR ---------------- */
.rps-main{ margin-left:260px; min-height:100vh; display:flex; flex-direction:column; }
.rps-topbar{
  position:sticky; top:0; z-index:1020; background:#fff; padding:12px 24px;
  display:flex; align-items:center; justify-content:space-between;
  box-shadow:var(--rps-shadow); gap:16px;
}
.rps-topbar .toggle-btn{
  border:none;background:#f1f4fa;width:40px;height:40px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;color:#1f2733;
}
.rps-topbar .search-box{
  flex:1; max-width:420px; position:relative;
}
.rps-topbar .search-box input{
  border-radius:10px; border:1px solid #e6e9f2; padding:9px 16px 9px 38px; background:#f8f9fc; width:100%;
}
.rps-topbar .search-box i{ position:absolute; left:13px; top:11px; color:#9aa4b8; }
.rps-topbar .icon-btn{
  width:40px;height:40px;border-radius:10px;background:#f1f4fa;border:none;
  display:flex;align-items:center;justify-content:center;position:relative;color:#1f2733;
}
.rps-topbar .icon-btn .dot{
  position:absolute; top:6px; right:6px; width:8px; height:8px; border-radius:50%; background:var(--rps-danger);
  border:2px solid #fff;
}
.rps-topbar .user-chip{
  display:flex; align-items:center; gap:10px; padding:6px 14px 6px 6px; border-radius:30px; background:#f1f4fa;
}
.rps-topbar .user-chip .avatar{
  width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,var(--rps-primary),#5b8def);
  color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;
}

.rps-content{ padding:24px; flex:1; }

/* ---------------- CARDS ---------------- */
.rps-card{
  background:#fff; border-radius:var(--rps-radius); border:1px solid #eef0f6;
  box-shadow:var(--rps-shadow); padding:20px;
}
.stat-card{
  border-radius:var(--rps-radius); padding:20px; color:#fff; position:relative; overflow:hidden;
  box-shadow:var(--rps-shadow-lg); min-height:112px;
}
.stat-card .stat-icon{
  width:46px;height:46px;border-radius:12px;background:rgba(255,255,255,.18);
  display:flex;align-items:center;justify-content:center;font-size:20px;margin-bottom:10px;
}
.stat-card .stat-value{ font-size:26px; font-weight:800; line-height:1; }
.stat-card .stat-label{ font-size:12.5px; opacity:.9; margin-top:4px; }
.stat-card.bg-blue{background:linear-gradient(135deg,#1a56db,#2e6fe8);}
.stat-card.bg-green{background:linear-gradient(135deg,#0ea45a,#15c56d);}
.stat-card.bg-orange{background:linear-gradient(135deg,#f2a90d,#ffbf3f);}
.stat-card.bg-red{background:linear-gradient(135deg,#e0293f,#ff5464);}
.stat-card.bg-purple{background:linear-gradient(135deg,#6c3ce0,#9166f0);}
.stat-card.bg-teal{background:linear-gradient(135deg,#0e9aa4,#1ec9d4);}

.section-title{ font-weight:700; font-size:16px; margin-bottom:2px; }
.section-sub{ font-size:12.5px; color:#8a94a6; }

/* ---------------- TABLES ---------------- */
.table-rps thead th{
  background:#f8f9fc; font-size:12px; text-transform:uppercase; letter-spacing:.03em;
  color:#6b7385; border-bottom:1px solid #eef0f6; font-weight:700; white-space:nowrap;
}
.table-rps td{ vertical-align:middle; font-size:13.5px; }
.table-rps tbody tr:hover{ background:#f8faff; }

/* ---------------- BUTTONS ---------------- */
.btn-rps-primary{
  background:linear-gradient(135deg,var(--rps-primary),#2e6fe8); border:none; color:#fff;
  border-radius:10px; font-weight:600; padding:9px 18px;
}
.btn-rps-primary:hover{ color:#fff; filter:brightness(1.08); }
.btn-rps-soft{ background:var(--rps-primary-light); color:var(--rps-primary); border:none; border-radius:10px; font-weight:600; }
.btn-icon-sm{ width:32px;height:32px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; border:none; }

/* ---------------- FORMS ---------------- */
.form-control, .form-select{
  border-radius:10px; border:1px solid #e2e6ef; padding:9px 14px; font-size:14px;
}
.form-control:focus, .form-select:focus{
  border-color:var(--rps-primary); box-shadow:0 0 0 .2rem rgba(26,86,219,.12);
}
label.form-label{ font-weight:600; font-size:13px; color:#3a4256; }

/* ---------------- LOGIN PAGE ---------------- */
.rps-login-wrap{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at top left, #16274d, #0b1522 60%);
  padding:20px;
}
.rps-login-card{
  background:#fff; border-radius:20px; overflow:hidden; max-width:900px; width:100%;
  box-shadow:0 30px 60px rgba(0,0,0,.35); display:flex;
}
.rps-login-brand{
  flex:1; background:linear-gradient(160deg,var(--rps-primary),#123a99); color:#fff;
  padding:50px 40px; display:flex; flex-direction:column; justify-content:center;
}
.rps-login-form{ flex:1; padding:50px 40px; }

/* ---------------- MISC ---------------- */
.badge-soft-blue{ background:var(--rps-primary-light); color:var(--rps-primary); }
.divider-dot::before{content:"•"; margin:0 6px; color:#c7cddb;}
.chip{ padding:3px 10px; border-radius:20px; font-size:11.5px; font-weight:600; }

@media (max-width: 992px){
  .rps-sidebar{ transform:translateX(-100%); }
  .rps-sidebar.show{ transform:translateX(0); }
  .rps-main{ margin-left:0; }
}

.invoice-box{ background:#fff; border-radius:10px; }
.invoice-box table{ width:100%; border-collapse:collapse; }
.invoice-box th, .invoice-box td{ padding:8px; border:1px solid #dde2ee; font-size:13px; }
.invoice-box th{ background:#f1f4fa; }

@media print{
  .rps-sidebar, .rps-topbar, .no-print{ display:none !important; }
  .rps-main{ margin-left:0 !important; }
  body{ background:#fff; }
}
