:root {
  color-scheme: dark;
  --bg-canvas: #111217;
  --bg-primary: #181b1f;
  --bg-secondary: #22252b;
  --bg-hover: #2a2d35;
  --border: #2e3138;
  --text-primary: #e0e0e0;
  --text-secondary: #8b8fa3;
  --text-muted: #5a5e6e;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --green: #4ade80;
  --green-dim: rgba(74,222,128,0.15);
  --amber: #f59e0b;
  --red: #ef4444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-canvas);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

header .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

header h1 {
  font-size: 1.5rem;
  color: var(--accent);
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 20px;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background 0.3s;
}

nav a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

nav a.btn-login {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-radius: 20px;
  padding: 8px 20px;
}
nav a.btn-login:hover {
  background: #2563eb;
}

/* Cards */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

/* Produtos */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.product-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.2s;
}

.product-card:hover {
  border-color: var(--accent);
}

.product-card h3 {
  color: var(--accent);
  margin-bottom: 10px;
}

.product-card .price {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--green);
  margin: 10px 0;
}

.product-card .stock {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Botões */
button, .btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
}

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

button:disabled {
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: var(--red);
}

.btn-danger:hover {
  opacity: 0.9;
}

/* Forms */
input, select, textarea {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

label {
  display: block;
  margin-top: 10px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Quantidade */
.quantity-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.quantity-control button {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.2rem;
}

.quantity-control span {
  min-width: 40px;
  text-align: center;
  font-weight: bold;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* Status Badge */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-badge.pending {
  background: rgba(59,130,246,0.15);
  color: var(--accent);
}

.status-badge.paid {
  background: var(--green-dim);
  color: var(--green);
}

.status-badge.completed {
  background: rgba(74,222,128,0.15);
  color: var(--green);
}

.status-badge.failed {
  background: rgba(239,68,68,0.15);
  color: var(--red);
}

.status-badge.expired {
  background: rgba(168,85,247,0.15);
  color: #a855f7;
}

/* Responsivo */
@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    gap: 10px;
  }

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

  nav a {
    margin: 0;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }
}
