:root{
  --bg:#050505;
  --surface:#101010;
  --surface2:#161616;
  --surface3:#1d1d1d;
  --border:#252525;
  --text:#f5f5f5;
  --muted:#9b9b9b;
  --muted2:#707070;
  --red:#e50914;
  --red2:#b20710;
  --gold:#f7c948;
  --green:#22c55e;
  --green-soft:#14351f;
  --yellow:#facc15;
  --yellow-soft:#3b320b;
  --danger-soft:#3b1014;
  --blue:#38bdf8;
  --radius-lg:18px;
  --radius-md:14px;
  --radius-sm:10px;
  --ff-body:'Barlow',sans-serif;
  --ff-display:'Barlow Condensed','Barlow',sans-serif;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}

body{
  background:
    radial-gradient(circle at top, rgba(229,9,20,.09), transparent 28%),
    linear-gradient(180deg, #070707 0%, #030303 100%);
  color:var(--text);
  font-family:var(--ff-body);
  min-height:100vh;
}

a{color:inherit;text-decoration:none}
button,input,select,textarea{font-family:inherit}

.admin-wrap{
  min-height:100vh;
  display:grid;
  grid-template-columns:280px 1fr;
}

.admin-sidebar{
  background:rgba(8,8,8,.94);
  border-right:1px solid var(--border);
  padding:22px 16px;
  display:flex;
  flex-direction:column;
  position:sticky;
  top:0;
  height:100vh;
}

.admin-logo{
  padding:8px 8px 22px;
  border-bottom:1px solid rgba(255,255,255,.05);
  margin-bottom:16px;
}

.admin-logo h2{
  margin:0;
  font-family:var(--ff-display);
  font-size:28px;
  line-height:1;
  letter-spacing:1px;
  color:var(--red);
  text-transform:uppercase;
}

.admin-logo h2 span{color:#fff}

.admin-logo p{
  margin:8px 0 0;
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:1px;
}

.sidebar-nav{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.sidebar-link{
  display:flex;
  align-items:center;
  gap:12px;
  padding:13px 14px;
  border-radius:12px;
  color:#b5b5b5;
  font-weight:700;
  font-size:14px;
  text-transform:uppercase;
  letter-spacing:.4px;
  border:1px solid transparent;
  transition:.18s ease;
}

.sidebar-link i{
  width:18px;
  text-align:center;
  font-size:15px;
}

.sidebar-link:hover{
  background:#121212;
  border-color:#202020;
  color:#fff;
}

.sidebar-link.active{
  background:linear-gradient(180deg, rgba(229,9,20,.16), rgba(229,9,20,.08));
  border-color:rgba(229,9,20,.28);
  color:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}

.sidebar-footer{
  margin-top:auto;
  padding-top:18px;
  border-top:1px solid rgba(255,255,255,.05);
  display:flex;
  flex-direction:column;
  gap:6px;
}

.sidebar-footer .sidebar-link{font-size:13px}

.sidebar-link.logout{color:#f87171}

.sidebar-link.logout:hover{
  background:rgba(229,9,20,.08);
  border-color:rgba(229,9,20,.18);
}

.admin-main{
  padding:26px;
}

.admin-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:22px;
}

.admin-header h1{
  margin:0 0 6px;
  font-size:34px;
  line-height:1;
  font-family:var(--ff-display);
  letter-spacing:.6px;
  display:flex;
  align-items:center;
  gap:12px;
  text-transform:uppercase;
}

.admin-header p{
  margin:0;
  color:var(--muted);
  font-size:14px;
}

.admin-header strong{color:#fff}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius:12px;
  padding:10px 14px;
  font-weight:800;
  font-size:13px;
  border:1px solid transparent;
  transition:.18s ease;
  cursor:pointer;
  text-decoration:none;
  white-space:nowrap;
}

.btn-sm{padding:8px 12px;font-size:12px}

.btn-primary{
  background:linear-gradient(180deg, var(--red), var(--red2));
  color:#fff;
  box-shadow:0 10px 20px rgba(229,9,20,.2);
}

.btn-primary:hover{
  transform:translateY(-1px);
  filter:brightness(1.05);
}

.btn-outline{
  background:#111;
  border-color:#2a2a2a;
  color:#fff;
}

.btn-outline:hover{
  background:#171717;
  border-color:#383838;
}

.card{
  background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  border:1px solid var(--border);
  border-radius:20px;
  overflow:hidden;
  box-shadow:0 18px 36px rgba(0,0,0,.25);
}

.admin-card-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:18px 22px 16px;
  border-bottom:1px solid rgba(255,255,255,.05);
}

.admin-card-title{
  font-weight:800;
  letter-spacing:.3px;
  display:flex;
  align-items:center;
  gap:10px;
  text-transform:uppercase;
  font-size:16px;
}

.table-wrap{overflow-x:auto}

table{
  width:100%;
  border-collapse:collapse;
}

thead th{
  text-align:left;
  font-size:11px;
  letter-spacing:.7px;
  text-transform:uppercase;
  color:var(--muted);
  padding:14px 18px;
  border-bottom:1px solid rgba(255,255,255,.05);
  font-weight:800;
}

tbody td{
  padding:15px 18px;
  border-bottom:1px solid rgba(255,255,255,.05);
  font-size:14px;
  vertical-align:middle;
}

tbody tr:hover{
  background:rgba(255,255,255,.015);
}

tbody tr:last-child td{border-bottom:none}

.price-inline{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-family:var(--ff-display);
  font-weight:900;
  color:var(--gold);
  letter-spacing:.2px;
}

.price-icon{
  color:var(--gold);
  filter:drop-shadow(0 0 8px rgba(247,201,72,.18));
}

/* dashboard */
.dash-stats{
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:14px;
  margin-bottom:22px;
}

.stat-card{
  background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  border:1px solid var(--border);
  border-top:3px solid var(--red);
  border-radius:var(--radius-lg);
  padding:18px 16px;
  box-shadow:0 12px 30px rgba(0,0,0,.22);
  transition:transform .18s ease, border-color .18s ease;
}

.stat-card:hover{transform:translateY(-2px)}

.stat-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.stat-icon{
  width:38px;
  height:38px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#161616;
  border:1px solid #232323;
  color:#fff;
  font-size:15px;
}

.stat-val{
  font-family:var(--ff-display);
  font-size:30px;
  font-weight:900;
  line-height:1;
  margin:0;
  display:flex;
  align-items:center;
  gap:8px;
}

.stat-lbl{
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.7px;
}

.user-name{font-weight:700}
.user-mail{font-size:12px;color:var(--muted);margin-top:2px}
.ped-table-view{display:block}
.ped-cards-view{display:none}

.ped-card{
  display:flex;
  align-items:center;
  gap:14px;
  padding:15px 16px;
  border-bottom:1px solid rgba(255,255,255,.05);
}

.ped-card:last-child{border-bottom:none}

.ped-card-avatar{
  width:42px;
  height:42px;
  border-radius:12px;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#151515;
  border:1px solid #232323;
  color:#fff;
}

.ped-card-body{flex:1;min-width:0}

.ped-card-name{
  font-size:14px;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ped-card-sub{
  margin-top:3px;
  font-size:12px;
  color:var(--muted);
}

.ped-card-right{
  text-align:right;
  flex-shrink:0;
}

.ped-card-id{
  margin-top:2px;
  font-size:11px;
  color:var(--muted2);
}

/* productos */
.catalog-table{
  min-width:1080px;
}

.product-cell{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:320px;
}

.product-thumb{
  width:44px;
  height:44px;
  border-radius:10px;
  overflow:hidden;
  flex-shrink:0;
  background:#0f0f0f;
  border:1px solid #242424;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 4px 12px rgba(0,0,0,.25);
}

.product-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.product-meta{
  min-width:0;
}

.product-name{
  font-weight:800;
  color:#fff;
  font-size:14px;
  line-height:1.15;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:280px;
}

.product-cat{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}

.stock-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:28px;
  height:26px;
  padding:0 10px;
  border-radius:7px;
  font-size:12px;
  font-weight:800;
  border:1px solid transparent;
}

.stock-badge.zero{
  background:rgba(229,9,20,.14);
  color:#ff4b57;
}

.stock-badge.low{
  background:rgba(250,204,21,.14);
  color:#facc15;
}

.stock-badge.ok{
  background:rgba(34,197,94,.14);
  color:#29e06f;
}

.status-badge{
  display:inline-flex;
  align-items:center;
  gap:7px;
  height:28px;
  padding:0 12px;
  border-radius:7px;
  font-size:12px;
  font-weight:800;
  color:#29e06f;
  background:rgba(34,197,94,.16);
  border:1px solid rgba(34,197,94,.12);
}

.status-dot{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#29e06f;
  box-shadow:0 0 8px rgba(41,224,111,.45);
}

.actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.btn-stock{
  background:linear-gradient(180deg, #ff1620, #de0a13);
  color:#fff;
  box-shadow:0 8px 16px rgba(229,9,20,.22);
}

.icon-btn{
  width:38px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:9px;
  border:1px solid #4b1519;
  background:rgba(229,9,20,.12);
  color:#fff;
  cursor:pointer;
  transition:.18s ease;
}

.icon-btn:hover{filter:brightness(1.08)}

/* mobile topbar + drawer */
.mob-topbar,
.mob-overlay,
.mob-drawer{
  display:none;
}

@media (max-width: 1100px){
  .dash-stats{grid-template-columns:repeat(3,1fr)}
}

@media (max-width: 900px){
  .admin-wrap{grid-template-columns:1fr}
  .admin-sidebar{display:none}

  .mob-topbar{
    display:flex;
    position:sticky;
    top:0;
    z-index:300;
    height:58px;
    background:#000;
    border-bottom:1px solid #1a1a1a;
    align-items:center;
    justify-content:space-between;
    padding:0 14px;
  }

  .mob-topbar-logo{
    font-family:var(--ff-display);
    font-size:18px;
    font-weight:900;
    color:var(--red);
    text-transform:uppercase;
    letter-spacing:1px;
  }

  .mob-topbar-logo span{color:#fff}

  .mob-burger{
    width:40px;
    height:40px;
    border-radius:10px;
    background:#141414;
    border:1px solid #272727;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:5px;
    cursor:pointer;
  }

  .mob-burger span{
    width:17px;
    height:2px;
    background:#fff;
    border-radius:2px;
    transition:.22s ease;
  }

  .mob-burger.open span:nth-child(1){transform:translateY(7px) rotate(45deg)}
  .mob-burger.open span:nth-child(2){opacity:0}
  .mob-burger.open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

  .mob-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.72);
    z-index:350;
  }

  .mob-overlay.open{display:block}

  .mob-drawer{
    position:fixed;
    top:0;
    right:-320px;
    width:min(300px,85vw);
    height:100dvh;
    background:#0b0b0b;
    border-left:1px solid #1c1c1c;
    z-index:400;
    flex-direction:column;
    transition:right .25s ease;
  }

  .mob-drawer.open{
    right:0;
    display:flex;
  }

  .drawer-head{
    padding:22px 18px 18px;
    border-bottom:1px solid rgba(255,255,255,.05);
  }

  .drawer-head-title{
    font-family:var(--ff-display);
    font-size:22px;
    color:var(--red);
    font-weight:900;
    text-transform:uppercase;
  }

  .drawer-head-title span{color:#fff}

  .drawer-head-sub{
    color:var(--muted);
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:1px;
    margin-top:4px;
  }

  .drawer-nav{
    padding:10px 0;
    display:flex;
    flex-direction:column;
  }

  .drawer-link,
  .drawer-footer-link{
    display:flex;
    align-items:center;
    gap:12px;
    padding:14px 18px;
    font-size:14px;
    font-weight:800;
    color:#b9b9b9;
    border-left:3px solid transparent;
  }

  .drawer-link.active{
    color:#fff;
    background:rgba(229,9,20,.08);
    border-left-color:var(--red);
  }

  .drawer-link:hover,
  .drawer-footer-link:hover{
    background:#111;
    color:#fff;
  }

  .drawer-footer{
    margin-top:auto;
    border-top:1px solid rgba(255,255,255,.05);
    padding:10px 0;
  }

  .drawer-footer-link.logout{color:#f87171}
  .admin-main{padding:18px 14px}
}

@media (max-width: 680px){
  .admin-header{
    flex-direction:column;
    align-items:flex-start;
  }

  .admin-header h1{font-size:30px}
  .ped-table-view{display:none}
  .ped-cards-view{display:block}
  .admin-main{padding:14px 12px}
}