:root{
  --gold:#ff9f1c;
  --glass:rgba(255,255,255,.06);
  --border:rgba(255,255,255,.08);
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:Inter,sans-serif;
}

body{
  background:#050505;
  min-height:100vh;
  color:#fff;
  display:flex;
  overflow-x:hidden;
}

/* BACKGROUND */
.bg-pattern{
  position:fixed;
  inset:0;
  background-image:radial-gradient(rgba(255,159,28,.12) 1px,transparent 1px);
  background-size:6px 6px;
  z-index:0;
  pointer-events:none;
}

/* SIDEBAR */
.sidebar{
  width:250px;
  background:linear-gradient(180deg,#2a1408,#0c0603);
  padding:24px;
  display:flex;
  flex-direction:column;
  z-index:200;
}

.logo{width:180px;margin-bottom:30px;}

.sidebar a{
  display:flex;
  gap:10px;
  padding:12px;
  margin-bottom:8px;
  text-decoration:none;
  color:#ccc;
  border-radius:12px;
}

.sidebar a.active,
.sidebar a:hover{
  background:linear-gradient(135deg,#ff9f1c,#ff7a00);
  color:#000;
}

/* MAIN */
.main{
  flex:1;
  padding:28px;
  position:relative;
  z-index:5;
}

/* GLASS */
.glass{
  background:linear-gradient(135deg,rgba(255,255,255,.08),rgba(255,255,255,.03));
  border:1px solid var(--border);
  border-radius:20px;
  backdrop-filter:blur(18px);
}

/* HEADER */
.header{
  padding:20px;
  margin-bottom:24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.profile a{
  color:var(--gold);
  text-decoration:none;
  font-size:12px;
  font-weight:700;
}

.profile a:hover{ text-decoration:underline; }

.logout-btn{
  display:inline-block;
  margin-top:6px;
  padding:6px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  color:#1a100d !important;
  text-decoration:none !important;
  background:linear-gradient(135deg,#ff9f1c,#ff7a00);
  border:1px solid rgba(255,255,255,.2);
  box-shadow:0 6px 14px rgba(255,122,0,.25);
}

.logout-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 18px rgba(255,122,0,.35);
}

/* STATS */
.stats{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:20px;
  margin-bottom:24px;
}

.card{padding:20px;}
.card span{font-size:13px;opacity:.7;}
.card h2{font-size:26px;margin-top:6px;}

/* ACTION BAR */
.action-bar{
  display:grid;
  grid-template-columns:auto minmax(220px,260px) minmax(280px,1fr);
  align-items:end;
  gap:14px;
  margin-bottom:24px;
  z-index:50;
  padding:14px 16px;
}

.action-group{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.btn-primary{
  background:linear-gradient(135deg,#ff9f1c,#ff7a00);
  padding:12px 18px;
  border-radius:14px;
  font-weight:700;
  color:#000;
  cursor:pointer;
  text-decoration:none;
}

.btn-secondary{
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
  padding:12px 18px;
  border-radius:14px;
  font-weight:700;
  color:#fff;
  cursor:pointer;
}

.client-export-filter{
  min-width:220px;
  position:relative;
}

.client-export-filter label{
  display:block;
  margin-bottom:6px;
  font-size:12px;
  font-weight:700;
  color:#ffcc80;
}

.client-export-filter input{
  width:100%;
  height:48px;
  padding:0 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:linear-gradient(135deg,rgba(255,255,255,.1),rgba(255,255,255,.05));
  color:#fff;
  font-weight:600;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}

.client-export-filter input:focus{
  outline:none;
  border-color:rgba(255,159,28,.6);
  box-shadow:0 0 0 3px rgba(255,159,28,.12);
}

.client-export-filter input::placeholder{
  color:rgba(255,255,255,.6);
}

.search-box{
  min-width:280px;
  flex:1;
  display:flex;
  align-items:center;
  gap:10px;
  height:48px;
  padding:0 16px;
  border-radius:14px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  justify-self:end;
  width:100%;
}

.search-box i{
  color:#ffcc80;
  font-size:14px;
}

.search-box input{
  width:100%;
  border:none;
  background:transparent;
  padding:0;
  color:#fff;
}

.search-box input:focus{
  outline:none;
}

.search-box input::placeholder{
  color:rgba(255,255,255,.55);
}

/* TABLE */
.table-card{padding:16px;}
table{width:100%;min-width:900px;border-collapse:collapse;}
th,td{padding:14px 16px;white-space:nowrap;}
th{color:#ffcc80;}
tbody tr{border-top:1px solid var(--border);}

/* ACTION ICONS */
.action-col{
  display:flex;
  gap:10px;
}

.action-btn{
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.2);
  border-radius:8px;
  padding:8px 10px;
  cursor:pointer;
}

.action-btn i{color:#fff;font-size:14px;}

.action-btn.edit:hover{background:#ff9f1c;}
.action-btn.edit:hover i{color:#000;}

.action-btn.delete:hover{background:#ff4d4d;}

/* MODAL */
.modal-overlay{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.8);
  backdrop-filter:blur(6px);
  z-index:9999;
}

.modal-overlay.show{display:flex;}

.modal{
  width:460px;
  max-width:92vw;
  padding:24px;
}

.modal-header{
  display:flex;
  justify-content:space-between;
  margin-bottom:20px;
}

.close-btn{cursor:pointer;font-size:22px;}

/* FORM */
.form-group{margin-bottom:14px;}
.form-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.form-row .form-group{
  margin-bottom:0;
}
label{font-size:12px;color:var(--gold);}
input,select{
  width:100%;
  padding:10px;
  border-radius:10px;
  background:#111;
  border:1px solid var(--border);
  color:#fff;
}

.full-btn{width:100%;margin-top:12px;}

/* SIDEBAR OVERLAY */
.sidebar-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  display:none;
  z-index:150;
}

.sidebar-overlay.show{display:block;}

/* ACTION COLUMN FIX */
.action-col{
  display: flex;
  gap: 8px;
  justify-content: center;
  pointer-events: auto;
}

.action-btn{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.action-btn:hover{
  background: #ff9f1c;
  color: #000;
}
/* =========================
   MOBILE RESPONSIVE FIX
   (INVENTORY ONLY)
========================= */

/* ---------- Tablet & Below ---------- */
@media (max-width: 1024px){
  .main{
    padding: 20px;
  }

  table{
    min-width: 800px;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px){

  body{
    flex-direction: column;
  }

  /* Hide sidebar (toggle already exists) */
  .sidebar{
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    transition: 0.3s ease;
  }

  .sidebar.open{
    left: 0;
  }

  .main{
    padding: 16px;
  }

  /* Header */
  .header h1{
    font-size: 20px;
  }

  .header p{
    font-size: 11px;
  }

  /* Stats stack nicely */
  .stats{
    grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
    gap: 14px;
  }

  .card h2{
    font-size: 20px;
  }

  /* Action bar */
  .action-bar{
    justify-content: flex-start;
  }

  .search-box{
    min-width:100%;
    max-width:none;
  }

  /* TABLE HARD FIX */
  .table-card{
    overflow-x: auto;
  }

  table{
    min-width: 900px;
  }

  th, td{
    font-size: 13px;
    padding: 12px;
  }

  /* Action buttons touch friendly */
  .action-btn{
    width: 38px;
    height: 38px;
  }
}

/* ---------- Small Mobile ---------- */
@media (max-width: 480px){

  .stats{
    grid-template-columns: 1fr 1fr;
  }

  .card span{
    font-size: 11px;
  }

  .card h2{
    font-size: 18px;
  }

  /* Modal spacing */
  .modal{
    padding: 18px;
  }

  .form-row{
    grid-template-columns:1fr;
    gap:10px;
  }

  .modal-header h3{
    font-size: 16px;
  }

  input, select{
    font-size: 14px;
  }
}

/* Final device QA overrides */
@media (max-width: 768px){
  .action-bar{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    padding:14px;
  }

  .action-group,
  .client-export-filter{
    width:100%;
  }

  .action-bar .btn-primary,
  .action-bar .btn-secondary{
    width:100%;
    text-align:center;
  }

  .search-box{
    justify-self:stretch;
  }
}

@media (max-width: 390px){
  .main{
    padding:12px;
  }

  .header{
    padding:14px;
    border-radius:16px;
  }

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

  .modal{
    width:96vw;
    max-width:96vw;
    padding:14px;
    border-radius:14px;
  }
}


