/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-hover: #f8f9fb;
  --primary: #4f6ef7;
  --primary-light: #eef1fe;
  --primary-dark: #3b5bdb;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f0f1f3;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
  /* Status colors */
  --st-pending: #9ca3af;
  --st-pending-bg: #f3f4f6;
  --st-confirmed: #3b82f6;
  --st-confirmed-bg: #eff6ff;
  --st-dev: #f59e0b;
  --st-dev-bg: #fffbeb;
  --st-testing: #8b5cf6;
  --st-testing-bg: #f5f3ff;
  --st-done: #10b981;
  --st-done-bg: #ecfdf5;
  --st-closed: #4b5563;
  --st-closed-bg: #f9fafb;
  /* Priority colors */
  --pr-high: #ef4444;
  --pr-high-bg: #fef2f2;
  --pr-medium: #f59e0b;
  --pr-medium-bg: #fffbeb;
  --pr-low: #3b82f6;
  --pr-low-bg: #eff6ff;
}
html { font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ========== Layout ========== */
.app { max-width: 1280px; margin: 0 auto; padding: 24px 32px 80px; }

/* ========== Header ========== */
.header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #7c8ff0);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; box-shadow: 0 4px 12px rgba(79,110,247,0.3);
}
.header h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.header .subtitle { font-size: 12px; color: var(--text-secondary); }
.header-actions { display: flex; gap: 10px; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: var(--transition); white-space: nowrap;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,110,247,0.3); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 6px 10px; }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { background: #fef2f2; color: var(--pr-high); border: 1px solid #fecaca; }
.btn-danger:hover { background: var(--pr-high); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 6px; width: 32px; height: 32px; justify-content: center; }

/* ========== Stats Dashboard ========== */
.stats-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  transition: var(--transition); cursor: pointer;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -1px; }
.stat-card[data-status="all"] .stat-dot { background: var(--primary); }
.stat-card[data-status="pending"] .stat-dot { background: var(--st-pending); }
.stat-card[data-status="confirmed"] .stat-dot { background: var(--st-confirmed); }
.stat-card[data-status="dev"] .stat-dot { background: var(--st-dev); }
.stat-card[data-status="testing"] .stat-dot { background: var(--st-testing); }
.stat-card[data-status="done"] .stat-dot { background: var(--st-done); }
.stat-card[data-status="closed"] .stat-dot { background: var(--st-closed); }

/* ========== Toolbar ========== */
.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.search-box {
  position: relative; flex: 1; min-width: 200px;
}
.search-box input {
  width: 100%; padding: 9px 14px 9px 38px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: var(--surface);
  transition: var(--transition);
}
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); }
.filter-select {
  padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: var(--surface); cursor: pointer;
  transition: var(--transition); color: var(--text);
}
.filter-select:focus { outline: none; border-color: var(--primary); }
.view-toggle { display: flex; gap: 2px; background: var(--border-light); border-radius: var(--radius-sm); padding: 3px; }
.view-toggle button {
  padding: 6px 12px; border: none; background: transparent; border-radius: 4px;
  font-size: 12px; cursor: pointer; color: var(--text-secondary); transition: var(--transition); font-family: inherit;
}
.view-toggle button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); font-weight: 600; }

/* ========== Requirement Cards ========== */
.req-list { display: flex; flex-direction: column; gap: 10px; }
.req-card {
  background: var(--surface); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  transition: var(--transition); cursor: pointer; position: relative;
}
.req-card:hover { box-shadow: var(--shadow); border-color: #d1d5db; transform: translateY(-1px); }
.req-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.req-id { font-size: 12px; font-weight: 600; color: var(--text-tertiary); font-family: 'SF Mono', 'Consolas', monospace; }
.req-title { font-size: 15px; font-weight: 600; color: var(--text); flex: 1; line-height: 1.5; }
.req-card-body { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.req-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.req-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-light); }
.req-card-delete {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border: none; border-radius: 6px;
  background: transparent; color: var(--text-tertiary); cursor: pointer;
  display: none; align-items: center; justify-content: center;
  font-size: 14px; transition: all 0.15s; z-index: 1;
}
.req-card:hover .req-card-delete { display: flex; }
.req-card-delete:hover { background: #fee2e2; color: #ef4444; }
.table-delete-btn {
  border: none; background: none; cursor: pointer; padding: 4px 8px;
  border-radius: 4px; color: var(--text-tertiary); font-size: 14px;
  transition: all 0.15s; visibility: hidden;
}
tr:hover .table-delete-btn { visibility: visible; }
.table-delete-btn:hover { background: #fee2e2; color: #ef4444; }
.req-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-tertiary); }
.req-meta-item { display: flex; align-items: center; gap: 4px; }

/* ========== Badges ========== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
}
.badge-status { cursor: pointer; transition: var(--transition); }
.badge-status:hover { opacity: 0.85; }
.badge-pending { background: var(--st-pending-bg); color: var(--st-pending); }
.badge-confirmed { background: var(--st-confirmed-bg); color: var(--st-confirmed); }
.badge-dev { background: var(--st-dev-bg); color: var(--st-dev); }
.badge-testing { background: var(--st-testing-bg); color: var(--st-testing); }
.badge-done { background: var(--st-done-bg); color: var(--st-done); }
.badge-closed { background: var(--st-closed-bg); color: var(--st-closed); }
.badge-high { background: var(--pr-high-bg); color: var(--pr-high); }
.badge-medium { background: var(--pr-medium-bg); color: var(--pr-medium); }
.badge-low { background: var(--pr-low-bg); color: var(--pr-low); }
.badge-category { background: var(--primary-light); color: var(--primary); }
.tag {
  display: inline-flex; align-items: center; padding: 2px 8px;
  background: var(--border-light); color: var(--text-secondary);
  border-radius: 4px; font-size: 12px;
}

/* ========== Table View ========== */
.req-table-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); overflow: hidden; }
.req-table { width: 100%; border-collapse: collapse; }
.req-table th {
  text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); border-bottom: 1px solid var(--border);
  background: var(--surface-hover); white-space: nowrap;
}
.req-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--border-light); }
.req-table tr { cursor: pointer; transition: var(--transition); }
.req-table tr:hover { background: var(--surface-hover); }
.req-table tr:last-child td { border-bottom: none; }
.req-table .req-title-cell { font-weight: 600; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ========== Empty State ========== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-tertiary); }
.empty-state svg { margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state p { font-size: 13px; }

/* ========== Modal ========== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(2px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 90%; max-width: 640px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.96) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; z-index: 1;
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; padding: 4px; color: var(--text-tertiary); border-radius: 6px; transition: var(--transition); }
.modal-close:hover { background: var(--surface-hover); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--border-light);
  position: sticky; bottom: 0; background: var(--surface); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ========== Form ========== */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-label .required { color: var(--pr-high); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; font-family: inherit;
  background: var(--surface); color: var(--text); transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* Tag input */
.tag-input-wrap {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  min-height: 38px; align-items: center; transition: var(--transition);
}
.tag-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.tag-item { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: var(--primary-light); color: var(--primary); border-radius: 4px; font-size: 12px; }
.tag-item .tag-remove { cursor: pointer; opacity: 0.6; font-size: 14px; line-height: 1; }
.tag-item .tag-remove:hover { opacity: 1; }
.tag-input { border: none; outline: none; flex: 1; min-width: 80px; font-size: 13px; font-family: inherit; background: transparent; }

/* ========== Detail View ========== */
.detail-section { margin-bottom: 20px; }
.detail-label { font-size: 12px; color: var(--text-tertiary); font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-value { font-size: 14px; color: var(--text); }
.detail-value.large { font-size: 16px; font-weight: 600; line-height: 1.6; }
.detail-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.7; white-space: pre-wrap; background: var(--surface-hover); padding: 14px 16px; border-radius: var(--radius-sm); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.history-list { max-height: 200px; overflow-y: auto; }
.history-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.history-item:last-child { border-bottom: none; }
.history-time { color: var(--text-tertiary); font-size: 12px; white-space: nowrap; }
.history-text { color: var(--text-secondary); }

/* ========== Status Dropdown ========== */
.status-dropdown {
  position: absolute; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 100; min-width: 160px;
  display: none; border: 1px solid var(--border);
}
.status-dropdown.active { display: block; }
.status-option {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; transition: var(--transition);
}
.status-option:hover { background: var(--surface-hover); }
.status-option-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ========== Toast ========== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--text); color: #fff; padding: 12px 24px; border-radius: var(--radius);
  font-size: 14px; box-shadow: var(--shadow-lg); z-index: 2000;
  transition: transform 0.3s ease; opacity: 0;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: var(--st-done); }
.toast.error { background: var(--pr-high); }

/* ========== Tab Navigation ========== */
.tab-nav { display: flex; gap: 4px; margin-bottom: 24px; background: var(--border-light); border-radius: var(--radius); padding: 4px; }
.tab-nav button {
  flex: 1; padding: 10px 20px; border: none; background: transparent;
  border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer;
  color: var(--text-secondary); transition: var(--transition); font-family: inherit;
}
.tab-nav button.active { background: var(--surface); color: var(--primary); font-weight: 700; box-shadow: var(--shadow-sm); }
.tab-nav button .tab-count { font-size: 11px; font-weight: 600; color: var(--text-tertiary); margin-left: 6px; }
.tab-nav button.active .tab-count { color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ========== Todo Specific ========== */
.todo-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.todo-stat-card {
  background: var(--surface); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  transition: var(--transition); cursor: pointer;
}
.todo-stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.todo-stat-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.todo-stat-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.todo-stat-dot { width: 8px; height: 8px; border-radius: 50%; }
.todo-stat-value { font-size: 28px; font-weight: 700; letter-spacing: -1px; }
.todo-stat-card[data-status="all"] .todo-stat-dot { background: var(--primary); }
.todo-stat-card[data-status="pending"] .todo-stat-dot { background: var(--st-dev); }
.todo-stat-card[data-status="done"] .todo-stat-dot { background: var(--st-done); }

.todo-add-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.todo-add-bar input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: var(--surface); transition: var(--transition);
}
.todo-add-bar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.todo-list { display: flex; flex-direction: column; gap: 6px; }
.todo-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  transition: var(--transition);
}
.todo-item:hover { box-shadow: var(--shadow); border-color: #d1d5db; }
.todo-item.done { opacity: 0.6; }
.todo-item.done .todo-title { text-decoration: line-through; color: var(--text-tertiary); }

.todo-checkbox {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #d1d5db; cursor: pointer; margin-top: 1px;
  transition: var(--transition); position: relative; background: var(--surface);
}
.todo-checkbox:hover { border-color: var(--st-done); }
.todo-item.done .todo-checkbox { background: var(--st-done); border-color: var(--st-done); }
.todo-item.done .todo-checkbox::after {
  content: '✓'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #fff; font-size: 12px; font-weight: 700;
}

.todo-body { flex: 1; min-width: 0; }
.todo-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; word-break: break-word; }
.todo-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-tertiary); }
.todo-actions { display: flex; gap: 4px; flex-shrink: 0; opacity: 0; transition: var(--transition); }
.todo-item:hover .todo-actions { opacity: 1; }
.todo-action-btn {
  padding: 4px 8px; border: none; background: transparent; border-radius: 4px;
  cursor: pointer; color: var(--text-tertiary); font-size: 12px; transition: var(--transition); font-family: inherit;
}
.todo-action-btn:hover { background: var(--surface-hover); color: var(--text); }
.todo-action-btn.danger:hover { background: var(--pr-high-bg); color: var(--pr-high); }

/* ========== Attachments ========== */
.attach-section { margin-bottom: 18px; }
.attach-dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 24px 16px; text-align: center; cursor: pointer;
  transition: var(--transition); background: var(--surface-hover);
  position: relative;
}
.attach-dropzone:hover, .attach-dropzone.drag-over { border-color: var(--primary); background: var(--primary-light); }
.attach-dropzone-icon { font-size: 28px; margin-bottom: 6px; color: var(--text-tertiary); }
.attach-dropzone-text { font-size: 13px; color: var(--text-secondary); }
.attach-dropzone-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }
.attach-preview {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.attach-thumb {
  position: relative; width: 80px; height: 80px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); overflow: hidden; background: var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attach-thumb .attach-remove {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; border: none;
  cursor: pointer; font-size: 14px; line-height: 20px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: var(--transition);
}
.attach-thumb:hover .attach-remove { opacity: 1; }
.attach-file-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 12px; max-width: 200px;
}
.attach-file-item .file-icon { font-size: 18px; flex-shrink: 0; }
.attach-file-item .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; color: var(--text); }
.attach-file-item .file-size { color: var(--text-tertiary); white-space: nowrap; }
.attach-file-item .attach-remove {
  cursor: pointer; color: var(--text-tertiary); font-size: 16px; flex-shrink: 0;
  padding: 0 2px; border: none; background: none; line-height: 1;
}
.attach-file-item .attach-remove:hover { color: var(--pr-high); }
.attach-count {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; color: var(--text-tertiary);
}
.attach-count.has-files { color: var(--primary); font-weight: 500; }
/* Detail view attachments */
.detail-attach-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; margin-top: 8px;
}
.detail-attach-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer; transition: var(--transition);
  background: var(--surface);
}
.detail-attach-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.detail-attach-item img { width: 100%; height: 100px; object-fit: cover; display: block; }
.detail-attach-item .da-file {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 10px; text-align: center;
}
.detail-attach-item .da-file .da-icon { font-size: 32px; }
.detail-attach-item .da-file .da-name { font-size: 12px; color: var(--text); word-break: break-all; }
.detail-attach-item .da-file .da-size { font-size: 11px; color: var(--text-tertiary); }
/* Storage warning */
.storage-bar {
  margin-top: 10px; height: 4px; background: var(--border-light); border-radius: 2px;
  overflow: hidden;
}
.storage-bar-fill {
  height: 100%; border-radius: 2px; transition: width 0.3s;
  background: var(--st-done);
}
.storage-bar-fill.warn { background: var(--st-dev); }
.storage-bar-fill.danger { background: var(--pr-high); }
.storage-info { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }
/* Image lightbox */
.img-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: none; align-items: center; justify-content: center;
  z-index: 2000; cursor: pointer;
}
.img-lightbox.active { display: flex; }
.img-lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 4px; }
.img-lightbox-close {
  position: absolute; top: 20px; right: 20px;
  background: rgba(255,255,255,0.2); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 50%; font-size: 20px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ========== Responsive ========== */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .app { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .header-actions { width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
}
