@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600&family=Space+Grotesk:wght@500;600&display=swap");

:root {
  --bg: #f5f0e8;
  --ink: #1e1a16;
  --muted: #6e645a;
  --card: #ffffff;
  --accent: #e4572e;
  --accent-dark: #c84a25;
  --accent-2: #1b9aaa;
  --line: #e5ddd1;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.orb {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(0);
  opacity: 0.35;
}

.orb-one {
  background: radial-gradient(circle at 30% 30%, #f9d9c1, transparent 70%);
  top: -180px;
  left: -120px;
}

.orb-two {
  background: radial-gradient(circle at 60% 40%, #bfe3e6, transparent 70%);
  bottom: -200px;
  right: -160px;
}

.grid-sheen {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: 0.25;
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
}

.auth-brand {
  margin-bottom: 10px;
}

.sidebar {
  padding: 28px 20px;
  background: rgba(255, 255, 255, 0.88);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  display: grid;
  place-items: center;
}

.brand-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav a:hover {
  background: rgba(228, 87, 46, 0.12);
  color: var(--accent);
}

.nav a.active {
  background: var(--accent);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}

.content {
  padding: 32px 40px 60px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
}

.page-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.page-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.solid-btn,
button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.solid-btn:hover,
button:hover {
  background: var(--accent-dark);
}

.ghost-btn {
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.7);
}

.ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: rise 0.5s ease both;
}

.card.narrow {
  max-width: 520px;
}

.card h2 {
  margin-top: 0;
  font-family: "Space Grotesk", sans-serif;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

label span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-family: inherit;
  background: #fffdf9;
}

textarea {
  resize: vertical;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.checkbox input {
  width: auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  animation: rise 0.5s ease both;
  animation-delay: var(--delay);
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
}

.stat-card.accent {
  background: linear-gradient(140deg, #ffe6d8, #fff7f1);
}

.values-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.eye-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fffaf4;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 12px;
}

.eye-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: #fff7f1;
}

.eye-icon {
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 14px / 10px;
  position: relative;
  display: inline-block;
}

.eye-icon::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.eye-toggle.is-hidden .eye-icon::after {
  content: "";
  width: 20px;
  height: 2px;
  background: currentColor;
  position: absolute;
  top: 4px;
  left: -3px;
  transform: rotate(-35deg);
}

.sensitive-value {
  white-space: nowrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stack {
  display: grid;
  gap: 20px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 600;
  background: #faf6f0;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
}

.pill-admin {
  background: #ffe6d8;
  color: #b64827;
}

.pill-user {
  background: #e8f1f5;
  color: #2c5870;
}

.pill-active {
  background: #dff2e9;
  color: #1f6f4f;
}

.pill-inactive {
  background: #f3e7e5;
  color: #9b4a3f;
}

.list-clean {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.list-clean li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #fffaf4;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.link.danger {
  color: #c2352b;
}

button.link {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form input {
  min-width: 200px;
}

.pagination {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.page-btn {
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  background: #fffaf4;
}

.page-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.page-info {
  color: var(--muted);
  font-weight: 600;
}

.flash-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.flash {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
}

.flash-error {
  background: #ffe3dc;
  color: #b23b2f;
}

.flash-success {
  background: #e3f7ef;
  color: #1e7a55;
}

.helper {
  color: var(--muted);
  margin-top: 12px;
  font-size: 13px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.overlay.show {
  display: flex;
}

.overlay-card {
  background: white;
  padding: 28px 32px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-align: center;
  display: grid;
  gap: 8px;
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid #f0e5d7;
  border-top-color: var(--accent);
  margin: 0 auto 6px;
  animation: spin 1s linear infinite;
}

.muted {
  color: var(--muted);
}

@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.print-body {
  background: white;
}

.print-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.container-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.labels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48mm, 1fr));
  gap: 8mm;
  padding: 24px;
}

.label {
  width: 50mm;
  height: 30mm;
  padding: 4mm;
  border: 1px dashed #d3c7bc;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 3mm;
  background: white;
}

.label-barcode svg {
  width: 100%;
  height: 12mm;
}

.label-info {
  display: grid;
  gap: 2mm;
}

.label-code {
  font-size: 9pt;
  font-weight: 600;
}

.label-desc {
  font-size: 8pt;
  line-height: 1.1;
}

.label-price {
  font-size: 10pt;
  font-weight: 700;
  color: var(--accent);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .content {
    padding: 24px;
  }
}

@media print {
  .print-header {
    display: none;
  }

  .labels-grid {
    padding: 0;
  }

  .label {
    border: none;
  }
}
