
:root{
  --blue:#425CC7;
  --yellow:#FFB71B;
  --dark:#132048;
  --bg:#f5f7fb;
  --border:#e5e7eb;
  --text:#132048;
  --muted:#667085;
  --sidebar-width:300px;
}
*{box-sizing:border-box}
html,body{min-height:100%;margin:0}
body{
  font-family:Arial,Tahoma,sans-serif;
  background:var(--bg);
  color:var(--text);
  overflow-x:hidden;
}
.layout{min-height:100vh}
.sidebar{
  position:fixed;
  left:0;
  top:0;
  bottom:0;
  width:var(--sidebar-width);
  background:var(--dark);
  color:#fff;
  padding:18px 14px;
  overflow-y:auto;
  overflow-x:hidden;
  z-index:1000;
  box-shadow:8px 0 22px rgba(19,32,72,.12);
}
.sidebar::-webkit-scrollbar{width:8px}
.sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.25);border-radius:20px}
.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding:0 8px 16px;
  margin-bottom:10px;
  border-bottom:1px solid rgba(255,255,255,.12);
}
.logo{
  min-width:46px;
  height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--yellow);
  color:var(--dark);
  font-weight:800;
  border-radius:14px;
}
.brand strong{display:block;line-height:1.2}
.brand small{display:block;color:#ccd3ff;margin-top:4px}
.sidebar nav{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:8px 0 28px;
}
.sidebar nav a{
  display:block;
  color:#fff;
  text-decoration:none;
  padding:10px 12px;
  border-radius:10px;
  font-size:14px;
  line-height:1.25;
  white-space:normal;
}
.sidebar nav a:hover,
.sidebar nav a.active{background:rgba(255,255,255,.13)}
.content{
  margin-left:var(--sidebar-width);
  min-height:100vh;
  padding:24px 28px;
}
.card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:18px;
  padding:20px;
  margin-bottom:18px;
  box-shadow:0 8px 20px rgba(19,32,72,.05);
}
h1,h2,h3{margin-top:0}
.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.stat{background:#fff;border-radius:18px;padding:18px;border:1px solid var(--border)}
.stat b{font-size:28px;color:var(--blue);display:block}
.btn{
  display:inline-block;
  background:var(--blue);
  color:#fff;
  padding:10px 15px;
  border-radius:12px;
  border:0;
  text-decoration:none;
  cursor:pointer;
  font-weight:700;
  line-height:1.2;
}
.btn.secondary{background:var(--yellow);color:var(--dark)}
.btn.light{background:#eef1ff;color:var(--blue)}
input,select,textarea{
  width:100%;
  padding:12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  color:var(--text);
}
label{font-weight:700;margin-bottom:6px;display:block}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.table-wrap{width:100%;overflow-x:auto}
table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
  border-radius:14px;
  overflow:hidden;
}
th,td{
  padding:12px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:top;
}
th{background:#f1f4ff}
pre{white-space:pre-wrap;word-break:break-word}
.badge{
  padding:5px 9px;
  border-radius:99px;
  background:#eef1ff;
  color:var(--blue);
  font-weight:700;
  font-size:12px;
}
.badge.ok{background:#e8fff0;color:#087a35}
.badge.warn{background:#fff7dc;color:#8a6400}
.badge.err{background:#ffecec;color:#9a1c1c}
.notice{
  background:#fff8df;
  border:1px solid #ffe19b;
  border-radius:14px;
  padding:14px;
  margin-bottom:18px;
}
.rtl{direction:rtl;text-align:right}
.admin-topbar{
  display:none;
  background:var(--dark);
  color:#fff;
  padding:12px 14px;
  align-items:center;
  justify-content:space-between;
}
.menu-toggle{
  background:var(--yellow);
  color:var(--dark);
  border:0;
  border-radius:10px;
  padding:9px 12px;
  font-weight:800;
  cursor:pointer;
}
@media(max-width:1100px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:900px){
  .admin-topbar{display:flex;position:sticky;top:0;z-index:1100}
  .sidebar{
    transform:translateX(-105%);
    transition:.2s ease;
    width:86vw;
    max-width:320px;
  }
  body.sidebar-open .sidebar{transform:translateX(0)}
  .content{margin-left:0;padding:16px}
  .grid,.form-grid{grid-template-columns:1fr}
  table{font-size:13px}
}
