:root {
  --acc: #0a7;
  --bg: #f7f7f7;
  --text: #222;
  --border: #ddd;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  color: var(--text);
  background: #fff;
}

a {
  color: var(--acc);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px;
}

/* header & footer */
.site-header,
.site-footer {
  background: var(--bg);
  border-bottom: 1px solid #eee;
}
.site-footer {
  border-top: 1px solid #eee;
  border-bottom: none;
  margin-top: 40px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 20px;
  margin-right: 16px;
}

.nav a {
  margin-right: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name {
  font-size: 14px;
}

/* buttons */
.btn {
  display: inline-block;
  padding: 0.4em 0.9em;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}
.btn-primary {
  background: var(--acc);
  color: #fff;
  border-color: transparent;
}
.btn:hover {
  opacity: 0.9;
}

/* grid & cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.card .price {
  font-weight: bold;
}

/* table */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th,
.table td {
  border-bottom: 1px solid #eee;
  padding: 8px;
  text-align: left;
}
.table th {
  background: #fafafa;
}

/* badges */
.badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  background: #ddd;
  font-size: 12px;
}
.badge-warning {
  background: #f9d34e;
}
.badge-success {
  background: #66cc88;
}

/* forms */
.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  max-width: 320px;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 14px;
}

/* messages & errors */
.error {
  color: #c00;
  margin-bottom: 12px;
}

.total {
  font-size: 16px;
  font-weight: bold;
}

.cart-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* product detail */
.product-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.product-image img {
  max-width: 240px;
  height: auto;
  display: block;
}
.product-info {
  flex: 1;
}

/* message thread */
.thread {
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 16px;
  background: #fafafa;
}
.msg {
  margin-bottom: 10px;
}
.msg .meta {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}
.msg-buyer .body {
  background: #e8fff0;
}
.msg-seller .body {
  background: #e8f0ff;
}
.msg .body {
  padding: 6px;
  border-radius: 4px;
}
