:root{
  --bg:#f6f8fc;
  --surface:#ffffff;
  --surface-soft:#fbfcfe;
  --ink:#0f172a;
  --muted:#64748b;
  --line:#e6eaf0;
  --line-strong:#d9e0ea;
  --nav:#071a2f;
  --nav-2:#0b223d;
  --nav-soft:#1a314d;
  --orange:#ff6a00;
  --orange-2:#f97316;
  --green:#16a34a;
  --red:#dc2626;
  --shadow:0 8px 24px rgba(15,23,42,.06);
  --shadow-soft:0 2px 10px rgba(15,23,42,.04);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink)}
body{font-size:14px}
a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}

.shell{display:flex;min-height:100vh}

/* SIDEBAR */
.sidebar{
  width:258px;
  position:fixed;
  inset:0 auto 0 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,106,0,.10), transparent 28%),
    linear-gradient(180deg,var(--nav),#07182a);
  color:#fff;
  padding:18px 14px 24px;
  overflow-y:auto;
  border-right:1px solid rgba(255,255,255,.05);
  z-index:30;
}
.brand{
  display:flex;
  align-items:center;
  gap:11px;
  padding:8px 14px 20px;
  margin-bottom:8px;
  border-bottom:1px solid rgba(255,255,255,.07);
}
.brand-mark{
  width:40px;height:40px;border-radius:12px;
  display:grid;place-items:center;
  background:linear-gradient(135deg,#ff7a1a,#ff5a00);
  color:#fff;
  box-shadow:0 8px 22px rgba(255,106,0,.28);
  flex:0 0 auto;
}
.brand-mark svg{width:24px;height:24px}
.brand-title{font-weight:900;font-size:19px;letter-spacing:.2px;line-height:1}
.brand-sub{font-size:10px;color:#cbd5e1;margin-top:5px;font-weight:700;letter-spacing:.6px}

.nav-label{
  color:#7f93aa;
  font-size:10px;
  font-weight:800;
  letter-spacing:1.25px;
  text-transform:uppercase;
  padding:18px 13px 7px;
}
.nav-item{
  display:flex;
  align-items:center;
  gap:11px;
  min-height:44px;
  padding:0 12px;
  border-radius:10px;
  margin:3px 0;
  color:#dbe5ef;
  font-weight:600;
  position:relative;
  transition:.18s ease;
}
.nav-item svg{width:19px;height:19px;stroke-width:1.8;opacity:.95}
.nav-item:hover{background:rgba(255,255,255,.055);color:#fff;transform:translateX(1px)}
.nav-item.active{
  color:#ff8a33;
  background:linear-gradient(90deg,rgba(255,106,0,.13),rgba(255,255,255,.08));
}
.nav-item.active:before{
  content:"";
  position:absolute;
  left:-1px;
  top:7px;
  bottom:7px;
  width:3px;
  border-radius:3px;
  background:var(--orange);
  box-shadow:0 0 14px rgba(255,106,0,.45);
}

/* MAIN */
.main{
  margin-left:258px;
  width:calc(100% - 258px);
  min-height:100vh;
}
.topbar{
  height:72px;
  position:sticky;
  top:0;
  z-index:20;
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 28px;
}
.topbar-left{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  color:#1e293b;
}
.topbar-icon{
  width:32px;height:32px;border-radius:10px;
  display:grid;place-items:center;
  color:var(--orange);
  background:#fff7ed;
}
.topbar-icon svg{width:18px;height:18px}
.topbar-right{display:flex;align-items:center;gap:12px}
.user-chip{display:flex;align-items:center;gap:9px;color:#1f2937;font-weight:600}
.user-avatar{
  width:34px;height:34px;border:1px solid #fed7aa;border-radius:50%;
  display:grid;place-items:center;color:var(--orange);background:#fffaf5
}
.user-avatar svg{width:17px;height:17px}

.content{padding:26px 28px 42px;max-width:1680px;margin:0 auto}
.page-head{margin-bottom:18px}
.title{font-size:29px;line-height:1.1;margin:0;font-weight:900;letter-spacing:-.5px;color:#0f172a}
.subtitle{margin-top:6px;color:var(--muted);font-size:13px}

.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow-soft);
  padding:18px;
}
.card + .card{margin-top:18px}
.section{margin-top:18px}
.card-title{
  display:flex;align-items:center;gap:10px;
  font-size:18px;font-weight:900;margin:0 0 18px;color:#172033
}
.card-title-icon{
  width:30px;height:30px;border-radius:9px;
  background:#fff7ed;color:var(--orange);
  display:grid;place-items:center
}
.card-title-icon svg{width:18px;height:18px}

.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.stat{
  padding:18px;
  background:linear-gradient(180deg,#fff,#fcfdff);
}
.stat .label{font-size:12px;color:var(--muted);font-weight:700}
.stat .num{font-size:30px;font-weight:900;letter-spacing:-.6px;margin-top:8px}

/* FORM */
.form-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px 14px;
  align-items:end;
}
.field{display:flex;flex-direction:column;gap:7px;min-width:0}
.field label{
  font-size:12px;
  font-weight:800;
  color:#334155;
}
.field.wide{grid-column:span 2}
.field.full{grid-column:1/-1}
.field input,.field select,.field textarea,
input,select,textarea{
  width:100%;
  min-height:43px;
  border:1px solid var(--line-strong);
  background:#fff;
  color:#0f172a;
  border-radius:10px;
  padding:10px 12px;
  outline:none;
  transition:.18s ease;
}
textarea{min-height:92px;resize:vertical}
input:hover,select:hover,textarea:hover{border-color:#c7d0dc}
input:focus,select:focus,textarea:focus{
  border-color:#ff9b52;
  box-shadow:0 0 0 3px rgba(255,106,0,.10);
}
input::placeholder,textarea::placeholder{color:#a1aab7}

/* BUTTONS */
.btn{
  min-height:40px;
  border:0;
  border-radius:10px;
  padding:0 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight:800;
  cursor:pointer;
  transition:.18s ease;
  white-space:nowrap;
}
.btn svg{width:16px;height:16px}
.btn:hover{transform:translateY(-1px)}
.btn-primary{
  color:#fff;
  background:linear-gradient(135deg,#ff7a1a,#ff5a00);
  box-shadow:0 8px 16px rgba(255,106,0,.18);
}
.btn-primary:hover{box-shadow:0 10px 20px rgba(255,106,0,.24)}
.btn-muted{background:#f4f6f9;color:#334155;border:1px solid var(--line)}
.btn-dark{background:#0f172a;color:#fff}
.btn-danger{background:#fff1f2;color:#b91c1c;border:1px solid #fecdd3}

.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.between{justify-content:space-between}

/* TABLE */
.table-card{padding:0;overflow:hidden}
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;background:#fff}
th,td{
  text-align:left;
  padding:14px 15px;
  border-bottom:1px solid #edf0f4;
  vertical-align:middle;
}
th{
  color:#64748b;
  background:#fbfcfe;
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:1px;
  font-weight:900;
}
td{font-size:13px;color:#334155}
tbody tr:hover{background:#fcfdff}
tbody tr:last-child td{border-bottom:0}
.thumb{
  width:88px;height:52px;object-fit:cover;
  border-radius:10px;border:1px solid var(--line);background:#f8fafc
}

.badge{
  display:inline-flex;align-items:center;gap:6px;
  min-height:25px;padding:0 9px;border-radius:99px;
  font-size:10px;font-weight:900;letter-spacing:.4px
}
.badge.active,.badge.online{background:#e9f9ef;color:#15803d}
.badge.inactive,.badge.offline{background:#fff0f1;color:#be123c}

/* EMPTY STATE */
.empty-state{
  min-height:210px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  color:#718096;
  text-align:center;
  padding:34px;
}
.empty-icon{
  width:64px;height:64px;border-radius:50%;
  border:1px solid #e5e9f0;
  background:#f8fafc;
  display:grid;place-items:center;
  color:#8b99aa;
  margin-bottom:12px;
  position:relative;
}
.empty-icon:before,.empty-icon:after{
  content:"";position:absolute;width:5px;height:5px;border-radius:50%;background:#e2e8f0
}
.empty-icon:before{left:-13px;top:16px}
.empty-icon:after{right:-11px;bottom:10px}
.empty-icon svg{width:28px;height:28px}
.empty-title{font-weight:900;color:#334155;margin-bottom:4px}
.empty-text{font-size:12px;color:#94a3b8}

/* ALERTS */
.alert{padding:12px 14px;border-radius:11px;margin-bottom:16px;font-weight:600;border:1px solid}
.alert-ok{background:#effcf3;border-color:#bbf7d0;color:#166534}
.alert-bad{background:#fff1f2;border-color:#fecdd3;color:#9f1239}

/* PAGINATION */
.pagination{padding:14px 16px}

/* LOGIN */
.login-wrap{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:22px;
  background:
    radial-gradient(circle at 20% 20%,rgba(255,106,0,.14),transparent 25%),
    linear-gradient(135deg,#06172a,#0c2747);
}
.login-card{
  width:100%;max-width:430px;
  background:#fff;
  border-radius:20px;
  padding:28px;
  box-shadow:0 28px 60px rgba(0,0,0,.25)
}
.login-card h1{font-size:25px;letter-spacing:-.4px}

/* Mobile */
.mobile-toggle{display:none}
@media(max-width:1200px){
  .grid,.form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:820px){
  .sidebar{transform:translateX(-100%);transition:.2s}
  .sidebar.open{transform:translateX(0)}
  .main{margin-left:0;width:100%}
  .mobile-toggle{display:inline-flex}
  .topbar{padding:0 15px}
  .content{padding:18px 15px 30px}
  .grid,.form-grid{grid-template-columns:1fr}
  .field.wide{grid-column:span 1}
  .topbar-right .user-chip{display:none}
}
