:root {
  --primary: #1a365d;
  --primary-light: #2c5282;
  --accent: #e67e22;
  --accent-light: #f39c12;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #f1c40f;
  --bg: #f0f2f5;
  --card: #fff;
  --text1: #1a202c;
  --text2: #4a5568;
  --text3: #a0aec0;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text1); font-size: 14px; -webkit-tap-highlight-color: transparent; }
#app { min-height: 100vh; padding-bottom: 70px; }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); display: flex; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); z-index: 100; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 0 4px; text-decoration: none; color: var(--text3); font-size: 11px; transition: color .2s; }
.nav-item.active { color: var(--accent); }
.nav-item svg { margin-bottom: 2px; }

.page { min-height: 100vh; background: var(--bg); }
.header { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; padding: 16px 20px; display: flex; align-items: center; gap: 12px; }
.header-logo { width: 36px; height: 36px; border-radius: 8px; }
.header-title { font-size: 16px; font-weight: 600; }
.header-sub { font-size: 11px; opacity: .8; }
.page-body { padding: 16px; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card-title { font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); }
.stat-num { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text3); margin-top: 4px; }
.stat-card.accent .stat-num { color: var(--accent); }
.stat-card.success .stat-num { color: var(--success); }
.stat-card.danger .stat-num { color: var(--danger); }

.btn { display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 8px; padding: 12px 20px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s; width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { background: #d35400; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text2); width: auto; padding: 8px 14px; font-size: 12px; }
.btn-danger { background: var(--danger); color: #fff; width: auto; padding: 8px 14px; font-size: 12px; }
.btn-sm { padding: 6px 12px; font-size: 12px; width: auto; }
.btn-success { background: var(--success); color: #fff; }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 4px; font-weight: 500; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--card); color: var(--text1); outline: none; transition: border .2s; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { min-height: 80px; resize: vertical; }

.list-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--card); border-radius: var(--radius); margin-bottom: 8px; box-shadow: var(--shadow); }
.list-item-info { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-repairing { background: #dbeafe; color: #1e40af; }
.badge-done { background: #d1fae5; color: #065f46; }
.badge-settled { background: #e5e7eb; color: #374151; }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); z-index: 200; display: flex; align-items: flex-end; }
.modal { background: var(--card); border-radius: 16px 16px 0 0; padding: 20px; width: 100%; max-height: 85vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text3); cursor: pointer; }

.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), var(--primary-light)); padding: 20px; }
.login-logo { width: 80px; height: 80px; border-radius: 20px; margin-bottom: 16px; }
.login-title { color: #fff; font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-sub { color: rgba(255,255,255,.7); font-size: 13px; margin-bottom: 30px; }
.login-card { background: var(--card); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 360px; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.photo-item { aspect-ratio: 1; border-radius: 8px; overflow: hidden; position: relative; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-add { aspect-ratio: 1; border: 2px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text3); font-size: 24px; cursor: pointer; }

.tab-bar { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 4px; }
.tab-item { padding: 6px 14px; border-radius: 20px; font-size: 12px; white-space: nowrap; background: var(--card); color: var(--text2); border: 1px solid var(--border); cursor: pointer; }
.tab-item.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.empty { text-align: center; padding: 40px 20px; color: var(--text3); }
.toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: 8px; background: var(--text1); color: #fff; font-size: 13px; z-index: 999; animation: fadeIn .3s; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.input-row { display: flex; gap: 6px; align-items: center; }
.input-row .form-input, .input-row .form-select, .input-row .form-textarea { flex: 1; }
.btn-voice, .btn-scan { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; color: var(--accent); font-size: 16px; }
.btn-voice.active { background: var(--accent); color: #fff; animation: pulse .8s infinite; border-color: var(--accent); }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.scan-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: #000; z-index: 300; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.scan-overlay video { width: 100%; max-width: 400px; border-radius: 8px; }
.scan-overlay .scan-close { position: absolute; top: 40px; right: 20px; color: #fff; font-size: 24px; background: rgba(0,0,0,.5); border: none; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; }
