*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f172a; --surface: #1e293b; --surface2: #334155;
  --accent: #6366f1; --text: #e2e8f0; --muted: #94a3b8;
  --green: #4ade80; --amber: #f59e0b; --red: #f87171;
  --border: #334155;
}
body { background: var(--bg); color: var(--text); font-family: system-ui, sans-serif; font-size: 14px; }
.topnav { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 20px;
  display: flex; align-items: center; gap: 20px; height: 44px; position: sticky; top: 0; z-index: 100; }
.topnav .brand { color: var(--accent); font-weight: 700; font-size: 16px; margin-right: 8px; }
.topnav a { color: var(--muted); text-decoration: none; padding: 0 4px; height: 44px;
  display: flex; align-items: center; border-bottom: 2px solid transparent; }
.topnav a:hover { color: var(--text); }
.topnav a.active { color: var(--text); border-bottom-color: var(--accent); }
.content { padding: 24px; max-width: 1200px; margin: 0 auto; }
.page-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border-radius: 8px; padding: 16px; text-align: center; }
.stat-num { font-size: 28px; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 11px; margin-top: 4px; text-transform: uppercase; }
.card { background: var(--surface); border-radius: 8px; padding: 16px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center; }
.card-title { font-weight: 600; margin-bottom: 4px; }
.card-meta { color: var(--muted); font-size: 12px; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; text-align: left;
  padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 10px; border-bottom: 1px solid var(--surface2); }
tr:hover td { background: var(--surface); }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.badge-ok { background: #14532d; color: var(--green); }
.badge-warn { background: #451a03; color: var(--amber); }
.badge-fail { background: #450a0a; color: var(--red); }
.badge-inactive { background: var(--surface2); color: var(--muted); }
.sync-status { background: var(--surface); border-radius: 8px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.sync-ok { border-left: 3px solid var(--green); }
.sync-fail { border-left: 3px solid var(--red); }
.btn { padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-weight: 500; }
.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: var(--surface2); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-warn { background: var(--amber); color: #0f172a; }
.btn:hover { opacity: 0.85; }
.form-group { margin-bottom: 14px; }
.form-label { color: var(--muted); font-size: 11px; text-transform: uppercase; margin-bottom: 4px; display: block; }
.form-input { width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 5px; padding: 8px 10px; color: var(--text); font-size: 13px; }
.form-input:focus { outline: none; border-color: var(--accent); }
.form-select { width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 5px; padding: 8px 10px; color: var(--text); font-size: 13px; }
.form-hint { color: var(--amber); font-size: 10px; margin-top: 2px; }
.form-readonly { background: var(--surface2); border-color: var(--surface2); color: var(--muted); }
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar .form-input { flex: 1; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 340px; background: var(--surface);
  border-left: 1px solid var(--border); padding: 20px; overflow-y: auto; z-index: 200;
  transform: translateX(100%); transition: transform 0.2s ease; }
.drawer.open { transform: translateX(0); }
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 199; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.drawer-title { font-size: 15px; font-weight: 600; }
.drawer-close { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 300; display: none; align-items: center; justify-content: center; }
.modal { background: var(--surface); border-radius: 10px; padding: 24px; width: 440px; max-width: 95vw; }
.modal-full { background: var(--surface); border-radius: 10px; padding: 28px 32px;
  width: 92vw; max-width: 1100px; max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.form-section { margin-bottom: 20px; }
.form-section-title { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .06em;
  text-transform: uppercase; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 12px; }
.timeline-dot { position: absolute; left: -20px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; border: 2px solid var(--bg); }
.timeline-dot.current { background: var(--green); }
.timeline-dot.past { background: var(--accent); }
.timeline-dot.transfer { background: var(--amber); }
.timeline-card { background: var(--surface2); border-radius: 6px; padding: 10px 12px; }
.timeline-seller { font-weight: 600; margin-bottom: 4px; }
.timeline-dates { color: var(--muted); font-size: 11px; }
.transfer-preview { background: var(--bg); border: 1px solid var(--amber); border-radius: 6px;
  padding: 10px 14px; margin-bottom: 16px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
