* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 14px;
  font-family: Arial, sans-serif;
  background: #f2f4f7;
  color: #1f2d3a;
}

.app {
  width: 400px;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.box {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  padding: 10px;
}

.box-header { background: #bfe9ff; }

.line1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.line1 h1 {
  margin: 0;
  font-size: 28px;
}

.sr-link {
  background: #000;
  color: #fff;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
}

.line2 {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

h2 {
  margin: 0 0 8px 0;
  font-size: 17px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 34px;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #e0e8f1;
  border-radius: 8px;
  padding: 7px 8px;
  margin-bottom: 6px;
  background: #fbfdff;
}
.item.selected {
  background: #eaf5ff;
  border-color: #5ca8f6;
}

.left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
}

.badge {
  font-size: 11px;
  border: 1px solid #d6e0ea;
  background: #eef3f8;
  border-radius: 999px;
  padding: 2px 6px;
}

.text {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions button {
  border: 1px solid #ced8e3;
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}

.row-form {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 80px 76px;
  gap: 6px;
}

.row-form input, .row-form button, select, .modal-card input {
  border: 1px solid #cdd8e3;
  border-radius: 6px;
  padding: 7px 8px;
  font-size: 13px;
}

.row-form button {
  background: #1f7be5;
  color: #fff;
  border-color: #1f7be5;
  cursor: pointer;
}

.entries-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.empty {
  color: #7d8b9a;
  font-size: 13px;
  padding: 4px 0 8px;
}

.dragging { opacity: 0.5; }
.drop-hover { outline: 2px dashed #58aaf7; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.hidden { display: none; }

.modal-card {
  width: 360px;
  max-width: 100%;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #d8e2ec;
  padding: 12px;
}
.modal-card h3 {
  margin: 0 0 10px 0;
}
.modal-card label {
  display: block;
  font-size: 12px;
  margin: 8px 0 4px;
}
.modal-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.modal-actions button {
  border: 1px solid #cfd9e3;
  background: #fff;
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
}
.btn-primary {
  background: #1f7be5 !important;
  color: #fff;
  border-color: #1f7be5 !important;
}
.btn-danger {
  background: #d83a3a !important;
  color: #fff;
  border-color: #d83a3a !important;
}
