:root{
  --bg:#f4f4f4;
  --panel:#fff;
  --ink:#111;
  --muted:#737373;
  --line:#e2e2e2;
  --red:#e31b23;
  --dark:#111;
  --green:#168044;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:Inter,Arial,sans-serif;
  background:var(--bg);
  color:var(--ink);
}

button,input,select,textarea{
  font:inherit;
}

button{
  cursor:pointer;
  border:0;
}

.hidden{
  display:none!important;
}


/* LOGIN */

.login-screen{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  background:#101010;
}

.login-card{
  width:min(420px,100%);
  background:#fff;
  border-radius:18px;
  padding:36px;
  box-shadow:0 25px 80px #0008;
}

.brand{
  font-weight:900;
  letter-spacing:.04em;
  font-size:22px;
}

.brand span{
  color:var(--red);
  margin-left:7px;
}

.login-card p{
  color:var(--muted);
  margin:8px 0 25px;
}

.login-card label,
.form-grid label{
  display:flex;
  flex-direction:column;
  gap:7px;
  font-weight:700;
  font-size:14px;
}

.login-card input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.toolbar select{
  width:100%;
  padding:12px 13px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
  outline:none;
}

.login-card input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus{
  border-color:#999;
}

.full-btn{
  width:100%;
  margin-top:18px;
}

.primary{
  background:var(--red);
  color:#fff;
  padding:11px 17px;
  border-radius:9px;
  font-weight:800;
}

.primary:hover{
  filter:brightness(.92);
}

.secondary{
  background:#ededed;
  color:#111;
  padding:11px 17px;
  border-radius:9px;
  font-weight:800;
}

.ghost{
  background:transparent;
  color:inherit;
  padding:10px 0;
}

.error{
  color:#c00;
  font-size:13px;
  min-height:20px;
  margin-top:10px;
}


/* SIDEBAR */

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

.sidebar{
  width:250px;
  background:#111;
  color:#fff;
  position:fixed;
  inset:0 auto 0 0;
  padding:28px 18px;
  display:flex;
  flex-direction:column;
  z-index:10;
}

.sidebar .brand{
  margin:0 12px 38px;
}

.nav-label{
  font-size:10px;
  font-weight:900;
  letter-spacing:.16em;
  color:#666;
  padding:0 12px;
  margin:15px 0 8px;
}

.sidebar>a{
  color:#999;
  text-decoration:none;
  padding:13px 12px;
  border-radius:9px;
  margin-bottom:4px;
  font-weight:700;
  display:flex;
  gap:10px;
  align-items:center;
}

.sidebar>a:hover,
.sidebar>a.active{
  color:#fff;
  background:#252525;
}

.side-bottom{
  margin-top:auto;
  border-top:1px solid #333;
  padding:15px 12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.side-bottom a{
  color:#fff;
  text-decoration:none;
}


/* MAIN */

.main{
  margin-left:250px;
  width:calc(100% - 250px);
  padding:42px;
  max-width:1600px;
}

.mobile-header{
  display:none;
}

.page-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:20px;
  margin-bottom:28px;
}

.eyebrow{
  font-size:11px;
  font-weight:900;
  letter-spacing:.18em;
  color:#888;
  margin-bottom:7px;
}

.page-head h1{
  font-size:40px;
  line-height:1;
  margin:0 0 9px;
}

.page-head p{
  color:var(--muted);
  margin:0;
}


/* STATS */

.stats{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
  margin-bottom:22px;
}

.stat,
.panel{
  background:#fff;
  border:1px solid var(--line);
  border-radius:15px;
}

.stat{
  padding:22px;
  position:relative;
}

.stat-icon{
  position:absolute;
  right:20px;
  top:20px;
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#f1f1f1;
  font-weight:900;
}

.stat span{
  color:var(--muted);
  font-size:13px;
}

.stat strong{
  display:block;
  font-size:34px;
  margin-top:8px;
}


/* DASHBOARD */

.dashboard-grid{
  display:grid;
  grid-template-columns:2fr 1fr;
  gap:20px;
}

.intro{
  padding:26px;
}

.panel-title{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
}

.intro h2{
  margin:0;
  font-size:25px;
}

.intro p{
  color:#555;
  line-height:1.65;
}

.version-badge{
  background:#111;
  color:#fff;
  padding:6px 9px;
  border-radius:7px;
  font-size:11px;
  font-weight:900;
}

.progress-list{
  margin-top:24px;
  border-top:1px solid #eee;
}

.progress-list>div{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:13px 0;
  border-bottom:1px solid #eee;
}

.progress-list b{
  color:var(--green);
}

.progress-list em{
  color:#999;
  font-size:12px;
  font-style:normal;
}

.quick-panel{
  padding:25px;
}

.quick-action{
  width:100%;
  display:flex;
  align-items:center;
  gap:14px;
  background:#f7f7f7;
  padding:16px;
  border-radius:10px;
  margin-top:12px;
  text-align:left;
}

.quick-action:hover{
  background:#eee;
}

.quick-action strong{
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  background:#111;
  color:#fff;
  border-radius:8px;
  font-size:20px;
}

.quick-action b,
.quick-action small{
  display:block;
}

.quick-action small{
  color:#888;
  margin-top:3px;
}


/* TOOLBAR */

.toolbar{
  display:flex;
  gap:10px;
  margin-bottom:14px;
}

.search-box{
  background:#fff;
  border:1px solid var(--line);
  border-radius:9px;
  display:flex;
  align-items:center;
  padding:0 12px;
  max-width:430px;
  width:100%;
}

.search-box span{
  color:#888;
  font-size:22px;
}

.search-box input{
  border:0;
  outline:0;
  padding:12px 8px;
  width:100%;
}


/* TABLE */

.table-wrap{
  overflow:auto;
}

.table-wrap table{
  width:100%;
  border-collapse:collapse;
  min-width:780px;
}

.table-wrap th,
.table-wrap td{
  text-align:left;
  padding:15px;
  border-bottom:1px solid #eee;
  vertical-align:middle;
}

.table-wrap th{
  font-size:11px;
  color:#777;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.table-wrap tr:last-child td{
  border-bottom:0;
}

.prod-name{
  display:flex;
  align-items:center;
  gap:12px;
}

.prod-name img{
  width:52px;
  height:52px;
  object-fit:cover;
  border-radius:8px;
  background:#eee;
}

.prod-name small{
  display:block;
  color:#999;
  margin-top:3px;
}

.badge{
  display:inline-flex;
  padding:5px 8px;
  border-radius:99px;
  font-size:11px;
  font-weight:800;
}

.badge.on{
  background:#e7f7ed;
  color:#13753b;
}

.badge.off{
  background:#eee;
  color:#777;
}

.actions{
  white-space:nowrap;
}

.link{
  background:none;
  padding:6px;
  font-weight:800;
}

.link.danger{
  color:#c00;
}

.empty{
  padding:55px;
  text-align:center;
  color:#888;
}


/* FORM */

.form-panel{
  padding:25px;
}

.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
}

.form-grid .full{
  grid-column:1/-1;
}

.form-grid textarea{
  resize:vertical;
  line-height:1.5;
}

.check{
  flex-direction:row!important;
  align-items:center;
}

.check input{
  width:auto;
}

.form-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}


/* MODAL */

.modal{
  position:fixed;
  inset:0;
  background:#0009;
  display:grid;
  place-items:center;
  padding:20px;
  z-index:50;
}

.modal-card{
  background:#fff;
  width:min(800px,100%);
  max-height:92vh;
  overflow:auto;
  border-radius:17px;
  padding:28px;
}

.modal-card.small{
  width:min(600px,100%);
}

.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  margin-bottom:25px;
}

.modal-head h2{
  margin:0;
  font-size:25px;
}

.close{
  background:#eee;
  border-radius:50%;
  width:36px;
  height:36px;
  font-size:22px;
}


/* IMAGE PREVIEW */

.image-preview{
  border:1px solid var(--line);
  border-radius:12px;
  padding:14px;
}

.preview-label{
  font-size:10px;
  font-weight:900;
  letter-spacing:.15em;
  color:#888;
  margin-bottom:10px;
}

.preview-box{
  width:100%;
  height:180px;
  background:#f5f5f5;
  border-radius:9px;
  display:grid;
  place-items:center;
  overflow:hidden;
  color:#999;
}

.preview-box img{
  width:100%;
  height:100%;
  object-fit:contain;
}


/* FUTURE VARIANTS */

.future-box{
  border:1px dashed #bbb;
  background:#fafafa;
  border-radius:12px;
  padding:18px;
  display:flex;
  align-items:flex-start;
  gap:13px;
}

.future-icon{
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  background:#111;
  color:#fff;
  border-radius:8px;
}

.future-box b{
  display:block;
}

.future-box p{
  color:#777;
  font-size:13px;
  line-height:1.5;
  margin:5px 0 0;
}

.future-box>span{
  margin-left:auto;
  background:#eee;
  padding:5px 7px;
  border-radius:6px;
  font-size:10px;
  font-weight:900;
}


/* TOAST */

.toast{
  position:fixed;
  right:24px;
  bottom:24px;
  background:#111;
  color:#fff;
  padding:12px 16px;
  border-radius:9px;
  opacity:0;
  transform:translateY(10px);
  pointer-events:none;
  transition:.2s;
  z-index:100;
}

.toast.show{
  opacity:1;
  transform:none;
}

.toast.error{
  background:#b40000;
}


/* MOBILE */

@media(max-width:1000px){

  .sidebar{
    transform:translateX(-100%);
    transition:.2s;
  }

  .sidebar.open{
    transform:none;
  }

  .main{
    margin-left:0;
    width:100%;
    padding:20px;
  }

  .mobile-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:25px;
  }

  .stats{
    grid-template-columns:1fr 1fr;
  }

  .dashboard-grid{
    grid-template-columns:1fr;
  }

  .page-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .form-grid{
    grid-template-columns:1fr;
  }

  .form-grid .full{
    grid-column:auto;
  }

  .form-actions{
    justify-content:flex-start;
  }

}


@media(max-width:520px){

  .stats{
    grid-template-columns:1fr;
  }

  .toolbar{
    flex-direction:column;
  }

  .search-box{
    max-width:none;
  }

  .page-head h1{
    font-size:32px;
  }

  .modal-card{
    padding:20px;
  }

}
