:root {
  --bg: #0f1115;
  --card: #151920;
  --text: #e9ecf5;
  --muted: #9aa4bd;
  --accent: #7ee0c3;
  --accent-2: #5a9bff;
  --border: #1f2530;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 20% 20%, rgba(90,155,255,0.12), transparent 30%),
              radial-gradient(circle at 80% 0%, rgba(126,224,195,0.12), transparent 28%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(15,17,21,0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 700;
  letter-spacing: 0.4px;
}

.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
}

.nav-link.active {
  background: linear-gradient(120deg, rgba(126,224,195,0.2), rgba(90,155,255,0.2));
  border-color: var(--border);
}

.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-2); color: #0b0e12; display: grid; place-items: center; font-weight: 800; }

.content {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

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

.label { color: var(--muted); margin: 0 0 6px; }
.value { font-size: 1.6rem; margin: 0; font-weight: 700; }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; color: var(--muted); font-size: 0.95rem; }
.form input, .form textarea, .form select {
  width: 100%;
  padding: 12px;
  background: #0c0e12;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}

button, .pill, .ghost, .icon-btn {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0b0e12;
  font-weight: 700;
  transition: transform 0.12s ease;
}

button:hover, .pill:hover, .ghost:hover { transform: translateY(-1px); }

.ghost {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text);
}

.pill { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.pill.sm, button.sm { padding: 8px 10px; font-size: 0.9rem; }
.ghost.sm { padding: 8px 10px; font-size: 0.9rem; }
.danger { background: #ff6b6b; color: #0b0e12; }

.list { display: grid; gap: 10px; }
.list-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0d1016;
}
.list-row.link { text-decoration: none; color: inherit; }

.title { font-weight: 700; }
.meta { color: var(--muted); font-size: 0.9rem; }
.muted { color: var(--muted); }
.price { font-weight: 700; }

.order-row { display: grid; grid-template-columns: 1fr 100px 44px; gap: 8px; align-items: center; margin-bottom: 8px; }
.icon-btn {
  padding: 10px;
  background: #1a1f2a;
  color: var(--text);
}

.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--muted); font-weight: 500; }
.table tfoot th { text-align: right; }

.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form label { min-width: 160px; }
.inline { display: inline-block; }
.small { width: 110px; }
.error { color: #ff6b6b; font-weight: 600; }

.thumb { width: 60px; height: 60px; border-radius: 12px; overflow: hidden; background: #0b0e12; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.large { width: 140px; height: 140px; }

.invoice-columns { display: grid; grid-template-columns: 1fr; gap: 12px; }
.invoice-copy { padding: 14px; }

.invoice-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.invoice-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.orders-print { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }

.footer {
  padding: 18px 20px 30px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .content { padding: 12px; }
  .list-row { grid-template-columns: auto 1fr; }
  .order-row { grid-template-columns: 1fr 1fr 44px; }
}

@media print {
  body { background: #fff; color: #000; margin: 6mm; }
  .topbar, .footer, .ghost, .pill, button:not(.print-visible), .user-chip, .quick-actions, .order-row, #items { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  .invoice-columns { grid-template-columns: repeat(2, 1fr); gap: 6mm; }
  .list-row { border-color: #ccc; }
  .orders-print { grid-template-columns: repeat(2, 1fr); }
}
