:root{
  --navy:#17365d;
  --blue:#1f6feb;
  --blue2:#3b82f6;
  --bg:#f4f7fb;
  --panel:#fff;
  --text:#172033;
  --muted:#667085;
  --border:#e4e9f0;
  --green:#168a55;
  --red:#d92d20;
  --amber:#b7791f;
  --shadow:0 8px 24px rgba(20,45,80,.07);
  --radius:16px
}

*{
  box-sizing:border-box
}

html,
body{
  margin:0;
  padding:0;
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
  background:var(--bg);
  color:var(--text)
}

body{
  min-height:100vh
}

.app{
  min-height:100vh;
  display:flex
}

.sidebar{
  width:250px;
  background:#fff;
  border-right:1px solid var(--border);
  padding:20px 14px;
  position:fixed;
  inset:0 auto 0 0;
  z-index:20;
  display:flex;
  flex-direction:column
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:5px 10px 22px;
  text-decoration:none;
  color:var(--navy)
}

.brand img{
  width:42px;
  height:42px;
  object-fit:contain
}

.brand-mark{
  width:42px;
  height:42px;
  border-radius:12px;
  background:
    linear-gradient(
      135deg,
      #1f6feb,
      #55a7ff
    );
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:800
}

.brand strong{
  font-size:18px
}

.brand small{
  display:block;
  color:var(--muted);
  font-size:11px;
  margin-top:2px
}

.nav{
  display:grid;
  gap:5px
}

.nav a{
  display:flex;
  align-items:center;
  gap:11px;
  padding:11px 12px;
  border-radius:11px;
  color:#475467;
  text-decoration:none;
  font-size:14px;
  font-weight:600
}

.nav a:hover,
.nav a.active{
  background:#edf5ff;
  color:var(--blue)
}

.nav-icon{
  width:22px;
  text-align:center
}

.sidebar-bottom{
  margin-top:auto;
  border-top:1px solid var(--border);
  padding-top:14px
}

.role-box{
  background:#f7f9fc;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  font-size:12px
}

.role-box b{
  display:block;
  font-size:13px;
  color:var(--navy)
}

.main{
  margin-left:250px;
  width:calc(100% - 250px);
  min-height:100vh
}

.topbar{
  height:72px;
  background:#fff;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 28px;
  position:sticky;
  top:0;
  z-index:10
}

.topbar h1{
  font-size:20px;
  margin:0
}

.topbar p{
  margin:3px 0 0;
  color:var(--muted);
  font-size:12px
}

.top-actions{
  display:flex;
  align-items:center;
  gap:10px
}

.user-pill{
  background:#f6f8fb;
  border:1px solid var(--border);
  border-radius:12px;
  padding:8px 12px;
  font-size:12px
}

.content{
  padding:26px;
  max-width:1500px;
  margin:auto
}

.grid{
  display:grid;
  gap:16px
}

.stats{
  grid-template-columns:
    repeat(
      4,
      minmax(0,1fr)
    )
}

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow)
}

.stat{
  padding:18px
}

.stat .label{
  font-size:12px;
  color:var(--muted);
  font-weight:700
}

.stat .value{
  font-size:28px;
  font-weight:800;
  margin:8px 0 4px;
  color:var(--navy)
}

.stat .hint{
  font-size:12px;
  color:var(--muted)
}

.stat-icon{
  float:right;
  width:38px;
  height:38px;
  border-radius:11px;
  background:#edf5ff;
  color:var(--blue);
  display:grid;
  place-items:center;
  font-weight:800
}

.two{
  grid-template-columns:
    1.35fr 1fr
}

.section{
  padding:20px
}

.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:15px
}

.section-head h2{
  font-size:16px;
  margin:0
}

.section-head span{
  font-size:12px;
  color:var(--muted)
}

.table-wrap{
  overflow:auto
}

.table{
  width:100%;
  border-collapse:collapse;
  font-size:13px
}

.table th{
  text-align:left;
  background:#f8fafc;
  color:#667085;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.04em;
  padding:11px 10px;
  white-space:nowrap
}

.table td{
  padding:12px 10px;
  border-top:1px solid #edf0f4;
  white-space:nowrap
}

.empty{
  text-align:center;
  color:var(--muted);
  padding:28px
}

.badge{
  display:inline-flex;
  align-items:center;
  padding:4px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:700
}

.badge.green{
  background:#eaf8f1;
  color:var(--green)
}

.badge.red{
  background:#fff0ee;
  color:var(--red)
}

.badge.amber{
  background:#fff7e6;
  color:var(--amber)
}

.badge.blue{
  background:#edf5ff;
  color:var(--blue)
}

.btn{
  border:1px solid var(--border);
  background:#fff;
  color:#344054;
  border-radius:10px;
  padding:9px 13px;
  font-size:12px;
  font-weight:700;
  cursor:pointer
}

.btn:hover{
  background:#f8fafc
}

.btn.primary{
  background:var(--blue);
  border-color:var(--blue);
  color:#fff
}

.btn.primary:hover{
  background:#175dcc
}

.btn.danger{
  color:var(--red)
}

.btn:disabled{
  opacity:.55;
  cursor:not-allowed
}

.toolbar{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap
}

.input,
.select{
  width:100%;
  border:1px solid #d7dde7;
  border-radius:10px;
  padding:10px 11px;
  background:#fff;
  color:var(--text);
  outline:none
}

.input:focus,
.select:focus{
  border-color:var(--blue);
  box-shadow:
    0 0 0 3px
    rgba(31,111,235,.1)
}

.form-grid{
  display:grid;
  grid-template-columns:
    repeat(2,1fr);
  gap:14px
}

.field label{
  display:block;
  font-size:12px;
  font-weight:700;
  margin-bottom:6px;
  color:#475467
}

.modal{
  position:fixed;
  inset:0;
  background:
    rgba(15,23,42,.38);
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:50
}

.modal.open{
  display:flex
}

.modal-box{
  background:#fff;
  width:min(620px,100%);
  max-height:90vh;
  overflow:auto;
  border-radius:18px;
  box-shadow:
    0 20px 60px
    rgba(0,0,0,.2);
  padding:22px
}

.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:18px
}

.modal-head h2{
  margin:0;
  font-size:18px
}

.close{
  border:0;
  background:#f2f4f7;
  border-radius:9px;
  width:34px;
  height:34px;
  cursor:pointer
}

.alert{
  padding:11px 13px;
  border-radius:10px;
  font-size:12px;
  margin-bottom:14px;
  display:none
}

.alert.show{
  display:block
}

.alert.error{
  background:#fff1f0;
  color:#b42318;
  border:1px solid #ffd6d2
}

.alert.success{
  background:#ecfdf3;
  color:#027a48;
  border:1px solid #abefc6
}

.login-page{
  min-height:100vh;
  background:
    linear-gradient(
      135deg,
      #eef6ff 0%,
      #f8fbff 45%,
      #f4f7fb 100%
    );
  display:grid;
  place-items:center;
  padding:24px
}

.login-card{
  width:min(430px,100%);
  background:#fff;
  border:1px solid var(--border);
  border-radius:22px;
  box-shadow:
    0 18px 55px
    rgba(20,45,80,.12);
  padding:30px
}

.login-brand{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:24px
}

.login-brand .brand-mark{
  width:48px;
  height:48px
}

.login-brand h1{
  font-size:22px;
  margin:0
}

.login-brand p{
  font-size:12px;
  color:var(--muted);
  margin:3px 0 0
}

.login-card h2{
  font-size:20px;
  margin:0 0 6px
}

.login-card .sub{
  font-size:13px;
  color:var(--muted);
  margin:0 0 22px
}

.login-form{
  display:grid;
  gap:15px
}

.password-wrap{
  position:relative
}

.password-wrap .input{
  padding-right:72px
}

.show-pass{
  position:absolute;
  right:8px;
  top:7px;
  border:0;
  background:#f5f7fa;
  border-radius:8px;
  padding:7px 9px;
  font-size:11px;
  cursor:pointer
}

.login-foot{
  text-align:center;
  font-size:11px;
  color:var(--muted);
  margin-top:18px
}

.loading{
  color:var(--muted);
  padding:24px;
  text-align:center
}

.notice{
  padding:13px 15px;
  border:1px solid #cfe2ff;
  background:#f3f8ff;
  border-radius:12px;
  color:#24558e;
  font-size:12px;
  margin-bottom:16px
}

.kpi-line{
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-size:12px;
  margin:7px 0
}

.progress{
  height:7px;
  background:#edf1f5;
  border-radius:99px;
  overflow:hidden
}

.progress i{
  display:block;
  height:100%;
  background:
    linear-gradient(
      90deg,
      #1f6feb,
      #58a6ff
    )
}


@media(max-width:1100px){

  .stats{
    grid-template-columns:
      repeat(2,1fr)
  }

  .two{
    grid-template-columns:1fr
  }

}


@media(max-width:800px){

  .sidebar{
    position:static;
    width:100%;
    height:auto;
    border-right:0;
    border-bottom:1px solid var(--border)
  }

  .app{
    display:block
  }

  .main{
    margin-left:0;
    width:100%
  }

  .nav{
    grid-template-columns:
      repeat(3,1fr)
  }

  .sidebar-bottom{
    display:none
  }

  .content{
    padding:16px
  }

  .topbar{
    padding:0 16px
  }

  .topbar .user-pill{
    display:none
  }

}


@media(max-width:560px){

  .stats{
    grid-template-columns:1fr
  }

  .form-grid{
    grid-template-columns:1fr
  }

  .nav{
    grid-template-columns:
      repeat(2,1fr)
  }

  .topbar{
    height:auto;
    padding:14px 16px
  }

  .content{
    padding:12px
  }

  .section{
    padding:14px
  }

}