* { box-sizing: border-box; }
body { font-family: -apple-system, system-ui, sans-serif; margin: 0; background: #f5f5f7; color: #1d1d1f; }
.container { max-width: 900px; margin: 40px auto; padding: 20px; }
.card { background: white; border-radius: 8px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 16px; }
h1 { margin: 0 0 16px; font-size: 24px; }
h2 { margin: 0 0 12px; font-size: 18px; }
.btn { display: inline-block; background: #0066cc; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-size: 14px; text-decoration: none; }
.btn:hover { background: #0055aa; }
.btn.secondary { background: #f0f0f0; color: #333; }
.btn.danger { background: #d33; }
.btn.small { padding: 6px 12px; font-size: 12px; }
input, select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; width: 100%; margin-bottom: 8px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.muted { color: #888; font-size: 13px; }
.error { color: #c33; background: #fee; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.success { color: #2a2; background: #efe; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
th { font-weight: 600; color: #666; font-size: 12px; text-transform: uppercase; }
.status { padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.status.draft { background: #eee; color: #666; }
.status.sent { background: #fef3c7; color: #92400e; }
.status.completed { background: #d1fae5; color: #065f46; }
.toolbar { display: flex; gap: 8px; padding: 12px; background: #fff; border-bottom: 1px solid #ddd; align-items: center; position: sticky; top: 0; z-index: 10; }
.editor-layout { display: flex; height: calc(100vh - 60px); }
.editor-main { flex: 1; overflow: auto; padding: 20px; background: #ddd; }
.editor-side { width: 300px; background: white; padding: 16px; overflow: auto; border-left: 1px solid #ddd; }
.page-wrap { position: relative; margin: 0 auto 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); background: white; }
.field-box { position: absolute; border: 2px dashed #0066cc; background: rgba(0,102,204,0.1); cursor: move; font-size: 11px; padding: 2px; }
.field-box.sig { border-color: #0066cc; background: rgba(0,102,204,0.15); }
.field-box.date { border-color: #2a9; background: rgba(34,170,153,0.15); }
.field-box.text { border-color: #93c; background: rgba(153,51,204,0.15); }
.field-box .del { position: absolute; top: -10px; right: -10px; background: #c33; color: white; border-radius: 50%; width: 18px; height: 18px; text-align: center; font-size: 12px; line-height: 18px; cursor: pointer; }
.signer-pill { display: inline-block; background: #eef; padding: 4px 10px; border-radius: 12px; font-size: 12px; margin: 2px; }
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-content { background: white; padding: 24px; border-radius: 8px; max-width: 500px; width: 90%; }
canvas.sig-pad { border: 1px solid #ccc; width: 100%; height: 200px; background: #fafafa; touch-action: none; display: block; }
.field-overlay { position: absolute; border: 2px solid #0066cc; background: rgba(255,235,59,0.3); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; overflow: hidden; }
.field-overlay.filled { background: rgba(76,175,80,0.3); border-color: #4caf50; }
.field-overlay img { max-width: 100%; max-height: 100%; }
