/* ===== RESET & BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== WRAP ===== */
#sd-wrap { font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif; font-size: 14px; color: #1a1a1a; }

/* ===== ADMIN BAR ===== */
#sd-admin-bar { display: -webkit-box; display: -ms-flexbox; display: flex; background: #f0f4f8; border: 1px solid #c8d8e8; border-radius: 6px; padding: 8px 14px; margin-bottom: 1rem; -webkit-box-align: center; -ms-flex-align: center; align-items: center; gap: 12px; -ms-flex-wrap: wrap; flex-wrap: wrap; }
#sd-admin-bar span { font-size: 13px; font-weight: 600; color: #185FA5; margin-right: auto; }
#sd-admin-bar a { font-size: 12px; color: #185FA5; cursor: pointer; text-decoration: underline; }
#sd-admin-bar a.sd-btn-add { background: #185FA5; color: #fff; text-decoration: none; padding: 5px 14px; border-radius: 5px; font-size: 13px; }
#sd-admin-bar a.sd-btn-add:hover { background: #0C447C; }

/* ===== TABLE ===== */
.sd-table-wrap { overflow-x: auto; }
#sd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#sd-table thead th { text-align: left; padding: 9px 10px; border-bottom: 2px solid #ccc; font-weight: 700; color: #333; white-space: nowrap; background: #f8f8f6; }
#sd-table tbody tr { border-bottom: 1px solid #e8e8e4; }
#sd-table tbody tr:hover { background: #fafaf8; }
#sd-table tbody td { padding: 9px 10px; vertical-align: top; line-height: 1.6; }
.sd-col-name a { color: #185FA5; text-decoration: none; }
.sd-col-name a:hover { text-decoration: underline; }
.sd-col-target { color: #444; font-size: 12px; max-width: 280px; }
.sd-col-actions { white-space: nowrap; }
.sd-col-handle { width: 3%; color: #bbb; cursor: grab; text-align: center; font-size: 15px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
.sd-col-handle:hover { color: #888; }
tr.sd-dragging { opacity: 0.4; }
tr.sd-drag-over { outline: 2px solid #185FA5; outline-offset: -2px; }
.sd-edit-btn, .sd-del-btn { font-size: 11px; padding: 3px 9px; border-radius: 4px; cursor: pointer; border: 1px solid; background: #fff; margin-right: 3px; }
.sd-edit-btn { color: #185FA5; border-color: #aac8e8; }
.sd-edit-btn:hover { background: #eef4fb; }
.sd-del-btn { color: #A32D2D; border-color: #e8aaaa; }
.sd-del-btn:hover { background: #fdf0f0; }

/* ===== MODALS ===== */
.sd-modal-bg { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.45); z-index: 200; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; }
.sd-modal-box { background: #fff; border-radius: 10px; padding: 1.6rem 1.8rem; width: 540px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,0.2); }
.sd-modal-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 1.2rem; color: #185FA5; border-bottom: 1px solid #e0e0e0; padding-bottom: 0.7rem; }
.sd-form-row { margin-bottom: 12px; }
.sd-form-row label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; font-weight: 600; }
.sd-form-row input, .sd-form-row textarea { width: 100%; padding: 7px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px; font-family: inherit; color: #1a1a1a; background: #fff; }
.sd-form-row textarea { resize: vertical; min-height: 65px; }
.sd-form-error { font-size: 12px; color: #A32D2D; margin-top: 5px; display: none; }
.sd-modal-actions { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 8px; -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid #eee; }
.sd-modal-actions button { padding: 7px 18px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid #ccc; background: #fff; color: #333; font-family: inherit; }
.sd-modal-actions .sd-btn-ok { background: #185FA5; color: #fff; border-color: #185FA5; }
.sd-modal-actions .sd-btn-ok:hover { background: #0C447C; }
