/* Admin CMS layout — DY Auto Parts */
@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&display=swap");

:root {
  --bg: #0b0d11;
  --bg-2: #12161e;
  --surface: #181e29;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f3f5f8;
  --muted: #9aa3b2;
  --accent: #e11d2e;
  --accent-2: #ff4d5a;
  --ok: #22c55e;
  --warn: #f59e0b;
  --side-w: 240px;
  --font-display: "Bebas Neue", sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

/* ========== Login (reference: split brand + form) ========== */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.login-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(225, 29, 46, 0.28), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 255, 255, 0.05), transparent 45%),
    linear-gradient(155deg, #151a24 0%, #0b0d11 55%, #1a1014 100%);
  border-right: 1px solid var(--line);
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
  pointer-events: none;
}

.login-brand-top,
.login-brand-mid,
.login-brand-bot { position: relative; z-index: 1; }

.login-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.login-logo img {
  height: 48px;
  width: auto;
  filter: invert(1);
}

.login-logo strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  display: block;
  line-height: 1;
}

.login-logo span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-top: 0.25rem;
}

.login-kicker {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(225, 29, 46, 0.4);
  background: rgba(225, 29, 46, 0.12);
  color: #ff8a93;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-brand h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  letter-spacing: 0.04em;
  line-height: 0.95;
  margin-bottom: 1rem;
}

.login-brand h1 em {
  font-style: normal;
  color: var(--accent);
}

.login-brand p {
  max-width: 28rem;
  color: var(--muted);
  font-size: 1rem;
}

.login-brand-bot {
  color: var(--muted);
  font-size: 0.85rem;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 2rem;
  background: #0e1117;
}

.login-card {
  width: min(400px, 100%);
}

.login-card .eyebrow {
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.login-card h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.login-card .sub {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.95rem;
}

.field label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  height: 46px;
  padding: 0 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.field textarea {
  height: auto;
  min-height: 110px;
  padding: 0.75rem 0.9rem;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(225, 29, 46, 0.55);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 46px;
  padding: 0 1.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, background .2s, border-color .2s;
}

.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: rgba(255,255,255,.3); }
.btn-sm { height: 36px; padding: 0 0.85rem; font-size: 0.85rem; }
.btn-danger { background: rgba(225,29,46,.15); color: #ff8a93; border-color: rgba(225,29,46,.3); }

.login-err {
  display: none;
  margin-bottom: 0.9rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  background: rgba(225, 29, 46, 0.12);
  border: 1px solid rgba(225, 29, 46, 0.35);
  color: #ff8a93;
  font-size: 0.88rem;
}

.login-foot {
  margin-top: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.login-foot a { color: var(--accent-2); }

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { min-height: 38vh; }
}

/* ========== App shell ========== */
.admin-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #0a0c10;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.85rem;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.85rem;
}

.side-brand img {
  height: 34px;
  filter: invert(1);
}

.side-brand strong {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  font-size: 1.15rem;
  display: block;
  line-height: 1;
}

.side-brand small {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.side-nav {
  display: grid;
  gap: 0.2rem;
  flex: 1;
  overflow: auto;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.side-nav a:hover { background: rgba(255,255,255,.04); color: #fff; }
.side-nav a.active {
  background: linear-gradient(90deg, rgba(225,29,46,.22), rgba(225,29,46,.05));
  color: #fff;
  border-left: 2px solid var(--accent);
  padding-left: calc(0.75rem - 2px);
}

.side-nav .group {
  margin: 0.85rem 0.5rem 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(154,163,178,.7);
}

.side-foot {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
  display: grid;
  gap: 0.4rem;
}

.main {
  min-width: 0;
  padding: 1.25rem 1.5rem 2.5rem;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.topbar h1 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar p { color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.03em;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat span { color: var(--muted); font-size: 0.82rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}

.panel h2 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.panel > .hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.notice {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: rgba(225, 29, 46, 0.1);
  border: 1px solid rgba(225, 29, 46, 0.25);
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table.data th,
table.data td {
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

table.data th {
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-weight: 600;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.tag-ok { background: rgba(34,197,94,.15); color: #4ade80; }
.tag-default { background: rgba(245,158,11,.15); color: #fbbf24; }
.tag-new { background: rgba(225,29,46,.15); color: #ff8a93; }

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  padding: 1.4rem;
  text-align: center;
  color: var(--muted);
  background: rgba(0,0,0,.15);
}
.dropzone.dragover { border-color: var(--accent); color: #fff; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.quick-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.quick-card {
  display: block;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255,255,255,.04), transparent), var(--bg-2);
  transition: border-color .2s, transform .2s;
}
.quick-card:hover {
  border-color: rgba(225,29,46,.5);
  transform: translateY(-2px);
}
.quick-card strong { display: block; margin-bottom: 0.25rem; }
.quick-card span { color: var(--muted); font-size: 0.82rem; }

.mobile-toggle {
  display: none;
  position: fixed;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 60;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #fff;
  cursor: pointer;
}

@media (max-width: 960px) {
  .admin-app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform .2s;
    z-index: 50;
  }
  .admin-app.nav-open .sidebar { transform: none; }
  .mobile-toggle { display: grid; place-items: center; }
  .main { padding-top: 3.5rem; }
  .grid-2 { grid-template-columns: 1fr; }
}
