:root{
  --mk-blue:#1565d8;
  --mk-blue-dark:#0f4eb0;
  --mk-teal:#16b8a6;
  --mk-green:#22c55e;
  --mk-sidebar:#16243d;
  --mk-sidebar-2:#1b2c49;
  --mk-sidebar-active:#244069;
  --mk-bg:#f4f6fa;
  --mk-card-border:#e8ecf3;
  --mk-grad:linear-gradient(135deg,var(--mk-blue) 0%,var(--mk-teal) 100%);
}

*{box-sizing:border-box}
body{
  background:var(--mk-bg);
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  color:#1f2a3d;
  font-size:14px;
}

/* ---------- LOGIN ---------- */
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#0f4eb0 0%,#16b8a6 100%);padding:20px}
.login-card{background:#fff;border-radius:18px;max-width:420px;width:100%;
  padding:38px 34px;box-shadow:0 20px 60px rgba(8,30,63,.25)}
.login-logo{width:64px;height:64px;border-radius:16px;background:var(--mk-grad);
  display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;
  font-size:30px;margin:0 auto 14px}

/* ---------- LAYOUT ---------- */
.app{display:flex;min-height:100vh}
.sidebar{
  width:250px;background:var(--mk-sidebar);color:#cdd7e6;
  display:flex;flex-direction:column;position:fixed;top:0;bottom:0;left:0;
  z-index:1040;transition:transform .25s ease;overflow-y:auto}
.sidebar::-webkit-scrollbar{width:6px}
.sidebar::-webkit-scrollbar-thumb{background:#33486b;border-radius:3px}
.sidebar-brand{display:flex;align-items:center;gap:10px;padding:20px 18px;color:#fff}
.sidebar-brand .logo{width:40px;height:40px;border-radius:10px;background:var(--mk-grad);
  display:flex;align-items:center;justify-content:center;font-weight:800;font-size:20px;color:#fff;flex:0 0 auto}
.sidebar-brand .logo-img{width:42px;height:42px;border-radius:10px;object-fit:cover;flex:0 0 auto}
.sidebar-brand .name{font-weight:800;font-size:20px;letter-spacing:.5px;line-height:1}
.sidebar-brand .tag{font-size:9px;letter-spacing:.5px;color:#8aa0c0;text-transform:uppercase}
.nav-section{font-size:10px;text-transform:uppercase;letter-spacing:1px;
  padding:14px 20px 6px;color:#6b82a6}
.sidebar .nav-link{color:#aebfd6;border-radius:9px;margin:2px 12px;padding:10px 14px;
  display:flex;align-items:center;gap:11px;font-size:13.5px;font-weight:500}
.sidebar .nav-link i{width:18px;text-align:center;font-size:15px}
.sidebar .nav-link:hover{background:var(--mk-sidebar-2);color:#fff}
.sidebar .nav-link.active{background:var(--mk-sidebar-active);color:#fff;font-weight:600}
.sidebar .nav-link .chev{margin-left:auto;font-size:11px;transition:transform .2s}
.sidebar .submenu{list-style:none;padding:0 0 0 0;margin:0 12px}
.sidebar .submenu .nav-link{font-size:12.5px;padding:8px 14px 8px 40px;margin:1px 0}

.main{flex:1;margin-left:250px;display:flex;flex-direction:column;min-width:0}
.topbar{background:#fff;border-bottom:1px solid var(--mk-card-border);
  padding:12px 26px;display:flex;align-items:center;gap:16px;position:sticky;top:0;z-index:1030}
.topbar .page-title{font-size:22px;font-weight:800;margin:0;color:#15233c}
.content{padding:22px 26px 40px}

.topbar .icon-btn{position:relative;width:38px;height:38px;border-radius:10px;border:1px solid var(--mk-card-border);
  background:#fff;display:flex;align-items:center;justify-content:center;color:#5b6b85;cursor:pointer}
.topbar .icon-btn .dot{position:absolute;top:-4px;right:-4px;min-width:16px;height:16px;padding:0 4px;
  background:#ef4444;color:#fff;font-size:9px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-weight:700}
.user-chip{display:flex;align-items:center;gap:10px;cursor:pointer}
.user-chip .av,.avatar-c{width:38px;height:38px;border-radius:50%;background:var(--mk-grad);
  color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;flex:0 0 auto}
.user-chip .nm{font-weight:700;font-size:13px;line-height:1.1}
.user-chip .rl{font-size:11px;color:#7b8aa3}

/* ---------- CARDS / STATS ---------- */
.card{border:1px solid var(--mk-card-border);border-radius:14px;box-shadow:0 1px 3px rgba(16,34,64,.04)}
.card-header{background:#fff;border-bottom:1px solid var(--mk-card-border);
  font-weight:700;font-size:15px;border-radius:14px 14px 0 0;padding:14px 18px}
.stat-card{background:#fff;border:1px solid var(--mk-card-border);border-radius:14px;padding:18px 20px;
  display:flex;align-items:flex-start;justify-content:space-between;height:100%}
.stat-card .label{font-size:13px;color:#6b7a93;margin-bottom:6px}
.stat-card .value{font-size:30px;font-weight:800;line-height:1;color:#15233c}
.stat-icon{width:46px;height:46px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:20px}
.si-blue{background:#e5efff;color:var(--mk-blue)}
.si-green{background:#e3f9ec;color:#16a34a}
.si-teal{background:#e0f7f3;color:#0d9488}
.si-orange{background:#fff0e0;color:#ea7a18}
.si-red{background:#ffe9e9;color:#e23b3b}

.text-mk{color:var(--mk-blue)!important}
.bg-mk{background:var(--mk-grad)!important;color:#fff!important}
.btn-mk{background:var(--mk-grad);border:none;color:#fff;font-weight:600}
.btn-mk:hover{filter:brightness(.95);color:#fff}
.btn-soft{background:#eef3fb;border:1px solid #e2e9f4;color:#3a4d6b;font-weight:600}

/* progress mini */
.progress-mini{height:8px;border-radius:6px;background:#edf1f7}
.progress-mini .bar{height:100%;border-radius:6px}

/* table */
.table{font-size:13.5px}
.table > :not(caption) > * > *{padding:.7rem .75rem}
.table thead th{color:#6b7a93;font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.4px;border-bottom:1px solid var(--mk-card-border)}
.table-hover tbody tr:hover{background:#f7faff}

.rank-badge{width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  color:#fff;font-weight:700;font-size:12px}
.rank-1{background:#ef5350}.rank-2{background:#ffa726}.rank-3{background:#42a5f5}

.tag-pill{background:#e5efff;color:var(--mk-blue);border-radius:8px;padding:3px 10px;font-size:12px;font-weight:600;display:inline-block}

/* sidebar toggle (mobile) */
.sidebar-backdrop{display:none;position:fixed;inset:0;background:rgba(8,20,40,.5);z-index:1039}
.menu-toggle{display:none}

@media (max-width:991px){
  .sidebar{transform:translateX(-100%)}
  .sidebar.show{transform:translateX(0)}
  .sidebar.show + .sidebar-backdrop{display:block}
  .main{margin-left:0}
  .menu-toggle{display:flex}
  .topbar .page-title{font-size:18px}
}
