:root{
  --bg1:#07111d;
  --bg2:#0b1f36;
  --card: rgba(255,255,255,.08);
  --card2: rgba(255,255,255,.06);
  --line: rgba(255,255,255,.12);
  --txt: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --accent:#36c2ff;
  --accent2:#7c5cff;
  --danger:#ff5c7a;
  --ok:#2ee59d;
  --warn:#ffc84a;
  --shadow: 0 16px 60px rgba(0,0,0,.35);
  --r: 18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  color:var(--txt);
  background:
    radial-gradient(900px 500px at 20% 15%, rgba(54,194,255,.20), transparent 60%),
    radial-gradient(900px 500px at 80% 35%, rgba(124,92,255,.18), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
}

a{color:inherit;text-decoration:none}
.container{width:min(1100px, 92vw); margin:0 auto; padding:18px 0 40px}

/* topbar */
.topbar{
  position:sticky; top:0; z-index:30;
  backdrop-filter: blur(14px);
  background: rgba(7,17,29,.55);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap{
  width:min(1100px, 92vw);
  margin:0 auto;
  padding:12px 0;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
}
.brand{
  display:flex; align-items:center; gap:10px;
}
.logo{
  width:36px; height:36px; border-radius:12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: var(--shadow);
}
.brand h1{font-size:14px; margin:0}
.brand p{font-size:12px; margin:0; color:var(--muted)}

/* nav */
.nav{
  display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end;
}
.nav a{
  padding:9px 12px;
  border:1px solid transparent;
  border-radius:12px;
  color:var(--muted);
  font-size:13px;
}
.nav a.active{
  color:var(--txt);
  border-color: var(--line);
  background: rgba(255,255,255,.06);
}
.nav a:hover{color:var(--txt)}

/* cards */
.card{
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card .hd{
  padding:16px 16px 10px;
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
}
.title{
  margin:0;
  font-size:18px;
}
.sub{
  margin:0;
  font-size:12px;
  color:var(--muted);
}
.card .bd{padding:14px 16px 16px}
.row{display:flex; gap:12px; flex-wrap:wrap}
.col{flex:1 1 280px}

/* inputs */
.field{display:flex; flex-direction:column; gap:6px; margin-bottom:12px}
label{font-size:12px; color:var(--muted)}
input, select, textarea{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  outline:none;
  background: rgba(0,0,0,.18);
  color: var(--txt);
  font-size:14px;
}
textarea{min-height:86px; resize:vertical}

.btns{display:flex; gap:10px; flex-wrap:wrap}
.btn{
  border:0;
  padding:12px 14px;
  border-radius:14px;
  cursor:pointer;
  background: rgba(255,255,255,.09);
  border:1px solid var(--line);
  color:var(--txt);
  font-weight:700;
}
.btn.primary{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border:0;
}
.btn.danger{background: rgba(255,92,122,.16); border-color: rgba(255,92,122,.35)}
.btn.ok{background: rgba(46,229,157,.14); border-color: rgba(46,229,157,.35)}
.btn:disabled{opacity:.45; cursor:not-allowed}

/* list rows (mobile-first) */
.list{
  display:flex; flex-direction:column; gap:10px;
}
.item{
  padding:12px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
  display:flex; flex-direction:column; gap:10px;
}
.item .top{display:flex; justify-content:space-between; gap:10px; align-items:flex-start}
.badge{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  color:var(--muted);
}
.badge.ok{color: var(--ok); border-color: rgba(46,229,157,.35); background: rgba(46,229,157,.12)}
.badge.warn{color: var(--warn); border-color: rgba(255,200,74,.35); background: rgba(255,200,74,.12)}
.badge.danger{color: var(--danger); border-color: rgba(255,92,122,.35); background: rgba(255,92,122,.12)}

.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:10px}
@media (max-width:520px){
  .grid2{grid-template-columns: 1fr}
}

/* toast */
.toast-wrap{
  position:fixed; left:12px; right:12px; bottom:14px;
  display:flex; flex-direction:column; gap:10px; z-index:50;
  pointer-events:none;
}
.toast{
  pointer-events:auto;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  display:flex; justify-content:space-between; align-items:flex-start; gap:10px;
}
.toast .t{font-weight:800}
.toast .m{color:var(--muted); font-size:13px; margin-top:2px}

.filters{
  display:flex; gap:10px; flex-wrap:wrap;
  margin: 10px 0 16px;
}
.input{
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  color:#fff;
  outline:none;
  min-width: 180px;
  flex: 1;
}
.btn{
  padding:12px 16px;
  border-radius:12px;
  border:0;
  cursor:pointer;
}
.empty{opacity:.9; padding:14px}

.stockTable{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 14px;
}
.stockTable th,.stockTable td{
  padding:10px;
  border-bottom:1px solid rgba(255,255,255,.08);
  text-align:center;
  white-space:nowrap;
}
.stockTable th{text-align:center; opacity:.9}

.cardRow{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  border-radius: 16px;
  padding:14px;
  margin-bottom: 12px;
}
.cardRow .top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.brand{font-weight:800}
.model{opacity:.95; font-weight:700}
.desc{opacity:.8; font-size:.95rem; margin-top:4px}
.total{ text-align:left; }
.total span{opacity:.8; font-size:.85rem}
.total b{font-size:1.3rem}

.gridWh{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:8px;
}
.wh{
  display:flex;
  justify-content:space-between;
  padding:10px;
  border-radius:12px;
  background: rgba(0,0,0,.18);
}
.wh span{opacity:.8}

/* ===== Fix select colors (brand filter) ===== */
select.input{
  background: rgba(10, 25, 55, .45) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.18);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  padding-left: 42px; /* مساحة للسهم */
  position: relative;
}

/* سهم للـ select */
select.input{
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,.85) 50%),
    linear-gradient(135deg, rgba(255,255,255,.85) 50%, transparent 50%);
  background-position:
    14px 55%,
    20px 55%;
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

/* عند الفتح/التركيز */
select.input:focus{
  border-color: rgba(120,190,255,.65);
  box-shadow: 0 0 0 3px rgba(80,160,255,.18);
}

/* خيارات القائمة (قد لا تنطبق على كل المتصفحات بالكامل) */
select.input option{
  background: #fff;
  color: #111;
}

/* لو عندك دارك مود / خلفية داكنة */
select.input option:checked{
  background: #e6f2ff;
  color: #111;
}


/* ===== Larger warehouse badges ===== */
.badge.wh-badge{
  padding: 10px 12px !important;
  border-radius: 14px !important;
  font-size: 14px !important;
  line-height: 1 !important;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
}

.badge.wh-badge b{
  font-size: 16px;
  margin-right: 6px;
}

/* ترتيبهم شبكة على الموبايل */
.item .wh-wrap{
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
}
@media (max-width:520px){
  .item .wh-wrap{
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

.badge.warn{
  background: rgba(246,195,67,.15);
  border: 1px solid rgba(246,195,67,.35);
  color: #f6c343;
}





