/* CityShop Prototype - Common Design System */
@import url('theme.css');

:root {
  --primary: #c4452b;
  --primary-dark: #9e3520;
  --primary-light: #f8ede8;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #d63031;
  --info: #0984e3;
  --text: #2d3436;
  --text-secondary: #636e72;
  --text-muted: #b2bec3;
  --border: #dfe6e9;
  --bg: #f5f6fa;
  --white: #ffffff;
  --sidebar: #3d2918;
  --sidebar-hover: #5a3d2e;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --radius: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: var(--radius);
  font-size: 14px; cursor: pointer; transition: .2s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 24px; font-size: 16px; border-radius: 22px; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
}
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-success { background: #e8f8f5; color: var(--success); }
.tag-warning { background: #fef9e7; color: #b7950b; }
.tag-danger { background: #fdeaea; color: var(--danger); }
.tag-gray { background: #eee; color: #666; }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--danger); color: #fff; border-radius: 9px; font-size: 11px;
}

.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-body { padding: 16px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; }
.form-control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(196,69,43,.15); }
select.form-control { appearance: auto; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #fafafa; font-weight: 600; font-size: 13px; color: var(--text-secondary); }
tr:hover td { background: #fafafa; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card .label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-card .sub { font-size: 12px; color: var(--success); margin-top: 4px; }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

.proto-badge {
  position: fixed; top: 12px; right: 12px; z-index: 9999;
  background: rgba(0,0,0,.7); color: #fff; padding: 4px 12px;
  border-radius: 20px; font-size: 11px; pointer-events: none;
}

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; margin-bottom: 4px; }
.page-header p { color: var(--text-secondary); font-size: 13px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }

.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 10px 20px; cursor: pointer; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -2px; text-decoration: none;
}
.tab.active, .tab:hover { color: var(--primary); border-bottom-color: var(--primary); text-decoration: none; }

.switch {
  position: relative; width: 44px; height: 24px; background: #ccc;
  border-radius: 12px; cursor: pointer; display: inline-block;
}
.switch.on { background: var(--success); }
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: .2s;
}
.switch.on::after { left: 22px; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #fdcb6e);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 16px;
}

.product-img {
  width: 64px; height: 64px; border-radius: var(--radius);
  background: linear-gradient(135deg, #ffeaa7, #fab1a0);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
}

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--text-muted); }
