/* ===== Reset & Variables ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #f0f4fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #eef3fc;
  --bg-input: #f5f8fd;
  --bg-surface: #f7f9fc;
  --border-color: #d8e2f0;
  --border-light: #c4d4e8;
  --text-primary: #1a2a44;
  --text-secondary: #4a6080;
  --text-muted: #8899b0;
  --accent-blue: #2563eb;
  --accent-blue-dim: #93b4f8;
  --accent-blue-light: #dbeafe;
  --accent-green: #16a34a;
  --accent-red: #dc2626;
  --accent-orange: #ea580c;
  --accent-purple: #7c3aed;
  --accent-cyan: #0891b2;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

html, body {
  width: 100%; height: 100%;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  user-select: none;
  font-size: 13px;
  -webkit-tap-highlight-color: transparent;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-blue-dim); }

/* ===== Title Bar ===== */
#titlebar {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  border-bottom: 1px solid #1e3a8a;
  -webkit-app-region: drag;
}
.titlebar-drag {
  display: flex; align-items: center; gap: 8px; padding-left: 14px;
}
.titlebar-icon { color: #ffffff; font-size: 14px; }
.titlebar-title { font-size: 12px; color: rgba(255,255,255,0.9); font-weight: 500; }
.titlebar-controls { display: flex; -webkit-app-region: no-drag; }
.titlebar-btn {
  width: 46px; height: 36px; border: none; background: transparent;
  color: rgba(255,255,255,0.8); font-size: 12px; cursor: pointer;
  transition: all var(--transition-fast);
  display: flex; align-items: center; justify-content: center;
}
.titlebar-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.titlebar-btn-close:hover { background: var(--accent-red); color: white; }

/* ===== Toolbar ===== */
#toolbar {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.toolbar-left { display: flex; gap: 8px; flex-shrink: 0; }
.toolbar-center { flex: 1; display: flex; justify-content: center; }
.toolbar-right { flex-shrink: 0; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all var(--transition-normal);
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.3), transparent 60%);
  opacity: 0; transition: opacity var(--transition-fast);
}
.btn:hover::after { opacity: 1; }
.btn-icon { font-size: 13px; }

.btn-primary { background: var(--accent-blue); color: #fff; }
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }

.btn-secondary { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--accent-blue-dim); }

.btn-outline { background: transparent; color: var(--accent-blue); border: 1px solid var(--accent-blue-dim); }
.btn-outline:hover { background: var(--accent-blue-light); border-color: var(--accent-blue); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: rgba(37,99,235,0.06); color: var(--accent-blue); }

.btn-danger { background: transparent; color: var(--accent-red); border: 1px solid rgba(220,38,38,0.3); }
.btn-danger:hover { background: rgba(220,38,38,0.06); border-color: var(--accent-red); }

.btn-sm { padding: 4px 10px; font-size: 11px; }

/* ===== Search Box ===== */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: 20px; padding: 0 14px; width: 320px;
  transition: all var(--transition-normal);
}
.search-box:focus-within { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.search-icon { font-size: 12px; color: var(--text-muted); }
.search-box input {
  flex: 1; border: none; background: transparent; color: var(--text-primary);
  font-family: var(--font); font-size: 12px; padding: 7px 0; outline: none;
}
.search-box input::placeholder { color: var(--text-muted); }

/* ===== File Label ===== */
.file-label {
  font-size: 12px; color: var(--text-secondary);
  padding: 4px 12px; border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
}

/* ===== Main Content ===== */
#main-content {
  display: flex;
  height: calc(100vh - 36px - 52px - 28px);
  overflow: hidden;
}

/* ===== Left Panel ===== */
#left-panel {
  width: 320px; min-width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column;
  transition: width var(--transition-normal);
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
}
.panel-tab {
  flex: 1; padding: 10px; border: none; background: transparent;
  color: var(--text-muted); font-family: var(--font); font-size: 12px;
  font-weight: 600; cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}
.panel-tab::after {
  content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px;
  background: var(--accent-blue); transition: all var(--transition-normal);
  transform: translateX(-50%);
}
.panel-tab.active { color: var(--accent-blue); }
.panel-tab.active::after { width: 60%; }
.panel-tab:hover { color: var(--text-primary); background: rgba(37,99,235,0.04); }

.panel-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px;
}

/* ===== Config Sections ===== */
.config-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  animation: fadeSlideUp 0.3s ease both;
  box-shadow: var(--shadow-sm);
}
.config-section-title {
  font-size: 13px; font-weight: 700; color: var(--accent-blue);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.config-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
  animation: fadeSlideUp 0.2s ease both;
}
.config-row label {
  min-width: 55px; text-align: right; font-size: 12px;
  color: var(--text-secondary); font-weight: 500;
}
.config-row input {
  flex: 1; padding: 6px 10px; background: var(--bg-input);
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: var(--font); font-size: 12px;
  transition: all var(--transition-fast); outline: none;
}
.config-row input:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(37,99,235,0.12); }
.config-row .unit { color: var(--text-muted); font-size: 12px; }
.config-row .btn-delete {
  width: 24px; height: 24px; border: none; border-radius: 4px;
  background: transparent; color: var(--text-muted); cursor: pointer;
  font-size: 12px; transition: all var(--transition-fast);
  display: flex; align-items: center; justify-content: center;
}
.config-row .btn-delete:hover { background: rgba(220,38,38,0.08); color: var(--accent-red); }

/* Config table delete button */
.config-table .btn-delete {
  width: 22px; height: 22px; border: 1px solid var(--border-color); border-radius: 4px;
  background: var(--bg-surface); color: var(--text-muted); cursor: pointer;
  font-size: 11px; transition: all var(--transition-fast);
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
}
.config-table .btn-delete:hover {
  background: #fef2f2; border-color: #fca5a5; color: var(--accent-red);
}

/* Remark cost subsection */
.config-subsection {
  margin: 8px 0; padding: 0;
  border-left: 3px solid var(--accent-blue);
  background: var(--bg-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  overflow: hidden;
}
.config-subsection-title {
  font-size: 12px; font-weight: 700; color: var(--text-primary);
  padding: 6px 10px;
  background: var(--accent-blue-light);
  border-bottom: 1px solid var(--border-color);
}
.config-empty {
  color: var(--text-muted); font-size: 11px; padding: 6px 10px;
  font-style: italic;
}

/* Config table */
.config-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
  table-layout: fixed;
}
.config-table th {
  text-align: left; font-size: 10px; font-weight: 600;
  color: var(--text-muted); padding: 4px 6px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase; letter-spacing: 0.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.config-table td {
  padding: 4px 4px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
}
.config-table td.ct-label {
  color: var(--text-primary); font-weight: 600; white-space: nowrap;
  width: 30%;
}
.config-table input {
  width: 100%; padding: 4px 8px; background: #fff;
  border: 1px solid var(--border-color); border-radius: 4px;
  color: var(--text-primary); font-family: var(--font); font-size: 12px;
  outline: none; transition: all var(--transition-fast);
  -moz-appearance: textfield;
  box-sizing: border-box;
}
.config-table input::-webkit-inner-spin-button,
.config-table input::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0;
}
.config-table input:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }
.config-table-sm th { font-size: 10px; }
.config-table-sm td { padding: 3px 4px; }

.config-add-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-top: 1px dashed var(--border-color);
  margin-top: 4px;
}
.config-add-row input {
  flex: 1; min-width: 0; padding: 4px 8px; background: #fff;
  border: 1px solid var(--border-color); border-radius: 4px;
  color: var(--text-primary); font-family: var(--font); font-size: 11px;
  outline: none; transition: all var(--transition-fast);
  -moz-appearance: textfield; box-sizing: border-box;
}
.config-add-row input::-webkit-inner-spin-button,
.config-add-row input::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0;
}
.config-add-row input:focus { border-color: var(--accent-blue); }

.btn-apply {
  width: 100%; padding: 10px; margin-top: 8px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white; border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all var(--transition-normal);
  letter-spacing: 0.5px;
}
.btn-apply:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37,99,235,0.3); }
.btn-apply:active { transform: translateY(0); }

/* ===== Resize Handle ===== */
.resize-handle {
  width: 4px; cursor: col-resize;
  background: transparent;
  transition: background var(--transition-fast);
}
.resize-handle:hover, .resize-handle.active { background: var(--accent-blue); }

/* ===== Right Panel ===== */
#right-panel {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 600px;
  background: var(--bg-primary);
}

/* ===== Filter Bar ===== */
#filter-bar {
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}
.filter-row {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 6px;
}
.filter-row:last-child { margin-bottom: 0; }
.filter-group {
  display: flex; align-items: center; gap: 6px;
}
.filter-group label {
  font-size: 12px; color: var(--text-secondary); font-weight: 600;
  white-space: nowrap;
}
.filter-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.filter-tag {
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all var(--transition-normal);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  animation: scaleIn 0.2s ease both;
}
.filter-tag.active {
  background: var(--accent-blue-light);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}
.filter-tag:hover { border-color: var(--accent-blue-dim); color: var(--accent-blue); }

.input-sm {
  padding: 4px 8px; background: var(--bg-input);
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: var(--font); font-size: 11px;
  outline: none; transition: all var(--transition-fast);
}
.input-sm:focus { border-color: var(--accent-blue); }

/* ===== Stats Panel ===== */
#stats-panel {
  flex: 1; min-height: 180px;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}
#stats-content { height: 100%; overflow-y: auto; padding: 12px 16px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; gap: 8px;
}
.empty-icon { font-size: 36px; opacity: 0.3; }
.empty-state p { color: var(--text-muted); font-size: 13px; }

/* Stats Layout */
.stats-summary {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.stats-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
}
.stats-label { color: var(--text-muted); font-weight: 600; }
.stats-value { color: var(--accent-blue); font-weight: 700; font-size: 14px; }
.stats-value.green { color: var(--accent-green); }
.stats-value.red { color: var(--accent-red); }
.stats-value.orange { color: var(--accent-orange); }

.stats-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.stats-row-label { font-size: 12px; color: var(--text-secondary); font-weight: 700; margin-right: 4px; }

.stat-chip {
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
}
.stat-chip:hover { border-color: var(--accent-blue); color: var(--accent-blue); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.stat-chip.red { border-color: rgba(220,38,38,0.3); color: var(--accent-red); }
.stat-chip.red:hover { border-color: var(--accent-red); }
.stat-chip.green { border-color: rgba(22,163,74,0.3); color: var(--accent-green); }

.stats-divider {
  height: 1px; background: var(--border-color);
  margin: 10px 0;
}

/* Remark Cards Grid */
.remark-section-title {
  font-size: 13px; font-weight: 700; color: var(--accent-blue);
  margin: 12px 0 8px; display: flex; align-items: center; gap: 8px;
}
.remark-section-title::before, .remark-section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border-color);
}

.remark-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.remark-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-normal);
  animation: fadeSlideUp 0.35s ease both;
  cursor: default;
  box-shadow: var(--shadow-sm);
}
.remark-card:hover {
  border-color: var(--accent-blue-dim);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.remark-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  position: relative;
}
.remark-card-header::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; border-radius: 0 2px 2px 0;
}

.remark-card-name {
  font-size: 16px; font-weight: 700;
  cursor: pointer; transition: color var(--transition-fast);
}
.remark-card-name:hover { opacity: 0.8; text-decoration: underline; }

.remark-card-totals {
  display: flex; gap: 10px; font-size: 11px; font-weight: 600;
}
.remark-card-totals span { white-space: nowrap; }
.total-count { color: var(--text-secondary); }
.total-sales { color: var(--accent-green); }
.total-cost { color: var(--accent-red); }
.total-profit.positive { color: var(--accent-green); font-weight: 700; }
.total-profit.negative { color: var(--accent-red); font-weight: 700; }

.remark-card-body { padding: 6px 14px 10px; }

.remark-card-row {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 6px; margin: 1px -6px;
  font-size: 11px; font-weight: 500;
  cursor: pointer; transition: all var(--transition-fast);
  border-radius: 4px;
}
.remark-card-row:hover { background: rgba(37,99,235,0.06); }
.remark-card-row .type-name { color: var(--text-primary); font-weight: 600; min-width: 50px; cursor: pointer; }
.remark-card-row .type-name:hover { color: var(--accent-blue); }
.remark-card-row .type-count { color: var(--text-secondary); }
.remark-card-row .type-sales { color: var(--accent-green); }
.remark-card-row .type-cost { color: var(--accent-red); }
.remark-card-row .type-profit { font-weight: 700; cursor: pointer; }
.remark-card-row .type-profit:hover { text-decoration: underline; }
.remark-card-row .type-profit.positive { color: var(--accent-green); }
.remark-card-row .type-profit.negative { color: var(--accent-red); }

/* Bottom Summary */
.bottom-summary {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-top: 8px;
  animation: fadeSlideUp 0.4s ease both;
  box-shadow: var(--shadow-sm);
}
.summary-label { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.summary-item { font-size: 12px; font-weight: 600; }
.summary-item.green { color: var(--accent-green); }
.summary-item.red { color: var(--accent-red); }
.summary-item.blue { color: var(--accent-blue); }

/* ===== Data Table ===== */
#table-panel { flex: 1; overflow: hidden; }
.table-wrapper { height: 100%; overflow: auto; }

table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
thead { position: sticky; top: 0; z-index: 10; }
thead th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 700; font-size: 11px;
  padding: 8px 10px; text-align: center;
  border-bottom: 2px solid var(--accent-blue-dim);
  white-space: nowrap;
}
tbody tr {
  transition: background var(--transition-fast);
  animation: fadeIn 0.2s ease both;
}
tbody tr:hover { background: rgba(37,99,235,0.06); }
tbody td {
  padding: 6px 10px; text-align: center;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: var(--text-secondary);
  white-space: nowrap;
}
.col-id { text-align: left !important; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.col-id.copyable { cursor: pointer; transition: all var(--transition-fast); }
.col-id.copyable:hover { color: var(--accent-blue); background: var(--accent-blue-light); }
.col-id.copyable.copied { background: #dcfce7; color: var(--accent-green); }
.col-time { text-align: left !important; }

td.status-normal { color: var(--accent-green); font-weight: 600; }
td.status-banned { color: var(--accent-red); font-weight: 600; }
td.profit-positive { color: var(--accent-green); font-weight: 600; }
td.profit-negative { color: var(--accent-red); font-weight: 600; }

/* ===== Status Bar ===== */
#statusbar {
  height: 28px;
  display: flex; align-items: center;
  padding: 0 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 11px; color: var(--text-muted);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== Accent Colors for Remark Cards ===== */
.accent-blue .remark-card-header::before { background: var(--accent-blue); }
.accent-blue .remark-card-name { color: var(--accent-blue); }
.accent-blue .remark-card-header { background: rgba(37,99,235,0.06); }

.accent-orange .remark-card-header::before { background: var(--accent-orange); }
.accent-orange .remark-card-name { color: var(--accent-orange); }
.accent-orange .remark-card-header { background: rgba(234,88,12,0.06); }

.accent-green .remark-card-header::before { background: var(--accent-green); }
.accent-green .remark-card-name { color: var(--accent-green); }
.accent-green .remark-card-header { background: rgba(22,163,74,0.06); }

.accent-purple .remark-card-header::before { background: var(--accent-purple); }
.accent-purple .remark-card-name { color: var(--accent-purple); }
.accent-purple .remark-card-header { background: rgba(124,58,237,0.06); }

.accent-red .remark-card-header::before { background: var(--accent-red); }
.accent-red .remark-card-name { color: var(--accent-red); }
.accent-red .remark-card-header { background: rgba(220,38,38,0.06); }

.accent-cyan .remark-card-header::before { background: var(--accent-cyan); }
.accent-cyan .remark-card-name { color: var(--accent-cyan); }
.accent-cyan .remark-card-header { background: rgba(8,145,178,0.06); }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .remark-grid { grid-template-columns: 1fr; }
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
  html, body { font-size: 14px; overflow: auto; }

  /* Title bar */
  #titlebar { height: 44px; position: sticky; top: 0; z-index: 50; }
  .titlebar-title { font-size: 14px; }

  /* Toolbar - wrap */
  #toolbar {
    height: auto; flex-wrap: wrap; padding: 8px 10px; gap: 6px;
    position: sticky; top: 44px; z-index: 40;
  }
  .toolbar-left { flex-wrap: wrap; gap: 4px; width: 100%; }
  .toolbar-center { width: 100%; order: 10; }
  .toolbar-right { width: 100%; order: 11; text-align: center; }
  .btn { padding: 6px 10px; font-size: 12px; }
  .btn-icon { font-size: 12px; }
  .search-box { width: 100%; }

  /* Main content - full scroll */
  #main-content { flex-direction: column; height: auto; min-height: 0; }

  /* Left panel - drawer overlay */
  #left-panel {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 85vw; max-width: 340px; min-width: unset; z-index: 100;
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-right: 1px solid var(--border-color);
  }
  #left-panel.open { transform: translateX(0); }
  .resize-handle { display: none; }

  /* Panel header (close button) */
  .panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; background: var(--accent-blue); color: #fff;
  }
  .panel-header-title { font-size: 15px; font-weight: 700; }
  .panel-close-btn {
    width: 32px; height: 32px; border: none; border-radius: 50%;
    background: rgba(255,255,255,0.2); color: #fff; font-size: 16px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
  }
  .panel-close-btn:hover { background: rgba(255,255,255,0.3); }

  /* Drawer backdrop */
  .drawer-backdrop.show {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 99; display: block;
  }

  /* Right panel */
  #right-panel { min-width: unset; flex: 1; }

  /* Filter bar */
  #filter-bar { padding: 8px 10px; }
  .filter-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .filter-group { flex-wrap: wrap; width: 100%; }
  .filter-tags { max-height: 60px; overflow-y: auto; }

  /* Stats */
  .remark-grid { grid-template-columns: 1fr; }
  .stats-summary { gap: 8px; }
  .bottom-summary { flex-wrap: wrap; gap: 8px; }

  /* Table */
  #table-panel { flex: 1; min-height: 300px; }
  .table-wrapper { -webkit-overflow-scrolling: touch; }
  thead th, tbody td { padding: 5px 6px; font-size: 11px; }

  /* Status bar */
  #statusbar { height: 24px; font-size: 10px; padding: 0 10px; position: sticky; bottom: 0; }

  /* Mobile menu toggle */
  .mobile-menu-btn {
    display: inline-flex !important;
    width: 36px; height: 36px; border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); background: var(--bg-surface);
    align-items: center; justify-content: center; cursor: pointer;
    font-size: 18px; color: var(--text-primary);
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn { display: none !important; }
  .panel-header { display: none; }
}
