/* ============ ADMIN — BLANCO · NEGRO · ROJO ============ */
.admin-body { min-height: 100vh; display: flex; flex-direction: column; }

/* Login (serio, sobre fondo oscuro) */
.login-wrap { flex: 1; display: grid; place-items: center; padding: 2rem; background: var(--ink); }
.login-box { width: min(430px, 100%); }
.login-box .terminal-body { display: flex; flex-direction: column; gap: 1.1rem; }
.login-intro { border-left: 3px solid var(--red); padding-left: .9rem; color: #9d9da2; font-size: .8rem; line-height: 1.7; }
.login-intro b { color: #fff; }

/* Header admin */
.admin-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem 2rem; border-bottom: 1px solid var(--line); background: rgba(246,246,244,.94);
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(10px);
}
.admin-header .brand { display: flex; align-items: center; gap: .7rem; }
.admin-header .brand-img { height: 36px; width: 36px; border-radius: 2px; object-fit: cover; }
.admin-header .brand-name { font-family: var(--font-d); font-size: .95rem; color: var(--ink); text-transform: uppercase; }
.admin-header .brand-name .red { color: var(--red); }
.tabs { display: flex; gap: .2rem; overflow-x: auto; }
.tab {
  font-family: var(--font-m); font-weight: 700; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  padding: .55rem .9rem; cursor: pointer; background: transparent; border: 1px solid transparent;
  color: var(--dim); transition: all .15s; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.on { color: #fff; background: var(--ink); border-color: var(--ink); }

.admin-main { flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: 2rem; }
.view { display: none; }
.view.on { display: block; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat {
  border: 1px solid var(--line); background: var(--bg2); padding: 1.25rem; clip-path: var(--clip);
  transition: all .18s; box-shadow: var(--shadow);
}
.stat:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat .label { font-family: var(--font-m); font-size: .68rem; color: var(--dim); text-transform: uppercase; letter-spacing: .12em; }
.stat .value { font-family: var(--font-d); font-size: 1.7rem; margin-top: .5rem; color: var(--ink); }
.stat .sub { font-family: var(--font-m); font-size: .7rem; color: var(--dim); margin-top: .3rem; }
.stat .value.neon { color: var(--red); }
.stat .value.hot { color: #8c0000; }
.stat .value.cyan { color: var(--ink); }
.stat .value.warn { color: var(--warn); }

.panel {
  border: 1px solid var(--line); background: var(--bg2); clip-path: var(--clip);
  overflow: hidden; margin-bottom: 1.6rem; box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--panel2);
}
.panel-head h3 { font-family: var(--font-d); font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
thead th {
  font-family: var(--font-m); font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line);
  background: var(--panel2); white-space: nowrap;
}
tbody td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: rgba(225,6,0,.035); }

/* Product mini row */
.p-mini { display: flex; align-items: center; gap: .7rem; }
.p-mini img { width: 44px; height: 38px; object-fit: cover; border: 1px solid var(--line); }
.p-mini .p-name { font-weight: 700; font-size: .85rem; color: var(--ink); }
.p-mini .p-cat { font-family: var(--font-m); font-size: .66rem; color: var(--dim); }
.mono-td { font-family: var(--font-m); font-size: .74rem; color: var(--dim); }
.actions-td { display: flex; gap: .4rem; }
.mini-btn {
  font-family: var(--font-m); font-weight: 700; font-size: .68rem; padding: .42rem .62rem; cursor: pointer;
  background: transparent; border: 1px solid var(--line2); color: var(--dim); transition: all .14s;
}
.mini-btn:hover { border-color: var(--ink); color: var(--ink); }
.mini-btn.danger:hover { border-color: var(--red); color: var(--red); }
.mini-btn.ok:hover { border-color: var(--red); color: var(--red); }

/* Toolbar */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.search { flex: 1; min-width: 220px; }
.search input {
  width: 100%; background: #fff; border: 1px solid var(--line2); color: var(--text);
  padding: .72rem .95rem; font-family: var(--font-m); font-size: .8rem; outline: none;
}
.search input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11,11,13,.06); }

/* top productos */
.top-list { padding: .4rem 0; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1.2rem; border-bottom: 1px solid var(--line); font-size: .85rem; }
.top-row:last-child { border-bottom: none; }
.top-row .bar-wrap { flex: 1; height: 8px; background: var(--panel2); max-width: 180px; border-radius: 0; }
.top-row .bar { height: 100%; background: var(--red); }

/* Detail order */
.od-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; padding: 1.4rem 1.6rem; }
.od-block h4 { font-family: var(--font-m); font-weight: 700; font-size: .78rem; margin-bottom: .8rem; color: var(--red); letter-spacing: .12em; text-transform: uppercase; }
.od-line { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; padding: .34rem 0; border-bottom: 1px dashed var(--line2); }
.od-line .k { color: var(--dim); font-family: var(--font-m); font-size: .74rem; }
.od-items { list-style: none; }
.od-items li { display: flex; gap: .8rem; align-items: center; padding: .5rem 0; border-bottom: 1px dashed var(--line2); font-size: .85rem; }
.od-items img { width: 46px; height: 40px; object-fit: cover; border: 1px solid var(--line); }

/* upload */
.upload-zone {
  border: 1.5px dashed var(--line2); padding: 1.2rem; text-align: center; cursor: pointer;
  transition: all .15s; background: var(--panel2);
}
.upload-zone:hover { border-color: var(--red); }
.upload-zone img { max-height: 140px; margin-bottom: .6rem; border: 1px solid var(--line); }
.upload-zone .mono { font-size: .72rem; color: var(--dim); }
#imgInput { display: none; }

.status-select {
  font-family: var(--font-m); font-size: .74rem; background: #fff; border: 1px solid var(--line2);
  color: var(--text); padding: .5rem .65rem; cursor: pointer;
}
.status-select:focus { outline: none; border-color: var(--ink); }

.empty-note { padding: 2rem; text-align: center; color: var(--dim); font-family: var(--font-m); }

@media (max-width: 700px) {
  .od-grid { grid-template-columns: 1fr; }
  .admin-main { padding: 1.2rem; }
  .admin-header { padding: .7rem 1rem; flex-wrap: wrap; }
}